About 137,000 results
Open links in new tab
  1. How to put a case statement in a where clause - SQLServerCentral

    Oct 20, 2022 · Home Forums SQL Server 2012 SQL Server 2012 - T-SQL How to put a case statement in a where clause Post reply

  2. Conditional Statements in WHERE Clauses – SQLServerCentral

    May 22, 2001 · Conditional WHERE clauses in T-SQL using comparison operators Ever had a query where you wished you could be able to specify the operator (equal, not equal, greater …

  3. Using Case or If Else statements within joins - SQLServerCentral

    Nov 22, 2010 · Home Forums SQL Server 2005 T-SQL (SS2K5) Using Case or If Else statements within joins Post reply

  4. Using a SET statement inside of a CASE Statement

    Feb 19, 2021 · I want to update the contents of a variable using a CASE Statement; for example: I declare the variable and set the initial value, then I want to use a CASE Statement to append …

  5. ROW_NUMBER () ORDER BY with CASE clause - SQLServerCentral

    Oct 15, 2009 · Hi, I've a query that I'd like to order by 14 different clauses, so I send a variable @order and use the ORDER BY with a CASE clause: DECLARE @order INT= 1 SELECT …

  6. Referencing a case statement in the Where Clause

    May 1, 2012 · I am attempting to do this in the Where clause, however, do not know how to refer to a case statement. Take a look at the last line of the Where Clause to see exactly what i'm …

  7. Using an ALIAS table name in a CASE statement - SQLServerCentral

    Aug 2, 2018 · Hi there everyone I'm trying to use an ALIAS table name in a CASE statement, but I'm hitting problems. Any help would be much appreciated - thank you. I've used the datepart …

  8. Having a case or if statement in where clause on Max Date

    Apr 7, 2022 · Home Forums SQL Server 2019 SQL Server 2019 - Development Having a case or if statement in where clause on Max Date Post reply

  9. CASE Statement with Dates in WHERE clause - SQLServerCentral

    Mar 22, 2021 · Also, there is no CASE statement in SQL! In this language, CASE is an expression; expressions return a single value of a known data type, I would assume you want …

  10. CASE in FROM Clause - SQLServerCentral Forums

    Mar 25, 2004 · Hi, I want to use CASE statement in FROM clause, for example DECLARE @I INT SET @I = 1 SELECT * FROM TABLE_A A, CASE WHEN @I = 1 THEN TABLE_B ELSE …