Tags down


what is better (if) or (where) in sql?

By : B. Lai
Date : September 15 2020, 10:00 AM
I think the issue was by ths following , I don't think there is an answer valid in all scenarios (database products, select query, input size etc), but keep in mind :
1) Your solution based on IF will have only ONE select AND one LOOP, so if the system lose more time on selecting the records (es very complex query) maybe better going for one loop.
code :

Share : facebook icon twitter icon
Related Posts Related Posts :
  • can anybody help me to find the number of times the zero will occur from 1-1000
  • Surrogate vs Natural Primary Keys, *SPECIFICALLY* in a Data Warehouse. Is this debated?
  • Oracle SQL SAVEPOINT problems
  • How to concatenate aggregated rows unless one column equals a certain value in SQL?
  • How to get current Year in PLSQL stored procedure
  • SQL - Return UserIds that only reviewed an item as "poor"
  • Rollback date specific changes for user
  • format date in oracle SQL
  • Select distinct column in sql group by
  • SQL ORDER BY one of two column values with value used from first column if not null and other column if first column is
  • How do I make and access regex capture groups in Django without RawSQL?
  • Representing a binary tree in an SQL table using foreign keys
  • Regex or conversion for 'YYYY-MMM-DD'
  • How to join all different rows with the same ID but a different date and return it as a unique row with new columns like
  • Alternative to multiple SQL self-joins to transform a table
  • regexp replace to replace the second special character from the last in a string
  • Fix sql injection on Rails model scope
  • How to keep updating a table which is created from multiple tables with different update times
  • How to replace string in Oracle?
  • How to shorten SQL LIKE statement
  • Don't display row the condition is accomplished SQL
  • SQL Server : create a column based on the first occurrence of a value in another column
  • SQL Server: Replicate data from multiple tables into one
  • Case statement combining three tables
  • Issue with running Spark SQL query - column not found
  • There is a reserved word in my SQL statement
  • Populating data from legacy DB using Entity Framework Code First
  • How to remove all constraints on a table with SMO objects (SQL Server)?
  • Infinite loop with recursive SQL query
  • How to display day of the week instead of dates at line chart in Power BI?
  • Running total. CTE keeps running after the result has been fetched
  • Oracle 11 SQL : Split 1 row into x rows and insert a new column
  • Why is this 'WHEN THEN' SQL query not returning the expected result?
  • Filter rows within an analytical function - Oracle
  • Use analytical functions on a small data set but with all the data in the table
  • how to use bcp in client system not remote
  • How do I use an IN Clause in Sql Server Parameter
  • Display only records which are not duplicated
  • How to update 0 or null values with sequence number?
  • Linking two tables based on timestamp interval
  • Get previous month data in Azure Cosmos DB
  • Changing URLs in a SQL table
  • Rounding number up or down, based on 0.5 and closest to round number
  • snowflake Need to run sql insert in loop based on column value
  • Update column based on array search in postgresql
  • Getting SQL result where common column value result count is more than 1
  • How to convert a number into a format which will be separated by comma's by position in sql
  • Create Phone type column from the source of phone numbers
  • How to convert a column of array values
  • How to count the number of records in an sql database
  • fetch data using query builder by checking multiple data from same column in laravel
  • PostgresSQL - how to design an effective table
  • How to store emoji characters in DB2 database?
  • How to use PIVOT in SQL Server to convert a set of values into a column?
  • What is a clean way to copy a SQL table with more than 1000 rows?
  • Query to find tables without unique keys
  • scheduled job's job action exceeds 4000 characters in oracle
  • How can I improve performance of queries with window-functions, that seem to ignore indexes?
  • SQL CASE with one condition and multiple results
  • Issue with WHERE clause on similar data due to "SPACE" difference
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk