About 25,900 results
Open links in new tab
  1. 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 …

  2. 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

  3. CASE statement slows down query drastically - SQLServerCentral

    Jan 8, 2018 · Here are the execution plans with and without the case statement. My ultimate goal would be to improve the query.

  4. CASE Statement in GROUP BY – SQLServerCentral

    Feb 13, 2009 · However, let’s explore what happens when you do this on particular situation, a CASE statement in a GROUP BY clause.

  5. If or case statement to determine a join - SQLServerCentral

    Oct 26, 2011 · One of two options comes into my mind: * Dynamic SQL * Convert to left outer join instead, and use case statement to select from either of these two with a proper where clause, …

  6. 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

  7. 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 …

  8. 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 …

  9. 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 …

  10. Using a CASE Statement In A WHERE Clause - SQLServerCentral

    Apr 19, 2022 · I want to use a case statement in a where clause and I want to use getdate () in conjunction with a date field in my table (MyAuditDate) to determine which where clause I use.