About 50 results
Open links in new tab
  1. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server.

  2. sql - Is it possible to specify condition in Count ()? - Stack Overflow

    Feb 16, 2018 · 609 Is it possible to specify a condition in Count()? I would like to count only the rows that have, for example, "Manager" in the Position column.

  3. sql - Condition within JOIN or WHERE - Stack Overflow

    In "SQL Performance Tuning" by Peter Gulutzan and Trudy Pelzer, they tested multiple brands of RDBMS and found no performance difference. I prefer to keep join conditions separate from query …

  4. sql - Preventing Conditional INSERT/UPDATE Race Condition - Stack …

    3 As alluded to in the articles I posted to your last question (Conditional INSERT/UPDATE Race Condition and “UPSERT” Race Condition With MERGE) using MERGE along with HOLDLOCK is …

  5. SQL JOIN: what is the difference between WHERE clause and ON clause?

    SQL INNER JOIN - ON "always false" condition On the other hand, if the ON clause condition is "always false", then all the joined records are going to be filtered out and the result set will be empty.

  6. sql - how do I select a column based on condition? - Stack Overflow

    I have a variable called @status which I set before this select statement:

  7. sql server 2008 - SQL query with NOT LIKE IN - Stack Overflow

    May 22, 2023 · Please help me to write an SQL query with the condition as NOT LIKE IN.

  8. sql - How do I use select with date condition? - Stack Overflow

    Jan 20, 2009 · In sqlserver, how do I compare dates? For example: Select * from Users where RegistrationDate >= '1/20/2009' (RegistrationDate is datetime type) Thanks

  9. sql server - IF Condition in an SQL query - Stack Overflow

    Apr 20, 2012 · I'm a newbie to SQL Server. Please help me to write the following Logic in a query. If getnow() > today 4 PM Then SELECT * FROM table WHERE MailDate is Tomorrow Else …

  10. sql - querying WHERE condition to character length? - Stack Overflow

    The LENGTH () (MySQL) or LEN () (MSSQL) function will return the length of a string in a column that you can use as a condition in your WHERE clause. Edit I know this is really old but thought I'd …