About 144,000 results
Open links in new tab
  1. Sql Case Statement when is not null - Stack Overflow

    Feb 1, 2012 · CASE x WHEN null THEN is the same as CASE WHEN x = null THEN. But nothing equals null in that way. This means that you are always getting the ELSE part of your CASE statement. And …

  2. T-SQL CASE Clause: How to specify WHEN NULL - Stack Overflow

    I wrote a T-SQL Statement similar like this (the original one looks different but I want to give an easy example here): SELECT first_name + CASE last_name WHEN null THEN 'Max' ELSE 'Peter' EN...

  3. sql - CASE Statement using IS NULL and IS NOT NULL - Stack Overflow

    Jan 27, 2017 · 2 I'm building a new SQL table and I'm having some trouble with a CASE statement that I can't seem to get my head around. I have two different clauses to be met within the WHEN …

  4. sql server - CASE statement with IS NULL and NOT NULL - Database ...

    Is there any better way to write the lines below in SQL Server 2005? CASE WHEN (ID IS NULL) THEN 'YES' WHEN (ID IS NOT NULL) THEN 'NO' END AS ID_Value,

  5. mysql - Conditional NOT NULL case SQL - Stack Overflow

    You need to have when reply.replies IS NOT NULL NULL is a special case in SQL and cannot be compared with = or <> operators. IS NULL and IS NOT NULL are used instead.

  6. sql server - Using IS NULL in CASE Expression in WHERE Clause ...

    Aug 1, 2017 · I have a WHERE clause that I want to use a CASE expression in. However, my CASE expression needs to check if a field IS NULL. If the @UserRole variable value = 'Analyst', then the …

  7. sql - check for null date in CASE statement, where have I gone wrong ...

    Mar 16, 2010 · Id StartDate 1 (null) 2 12/12/2009 3 10/10/2009 I want to create a select statement, that selects the above, but also has an additional column to display a varchar if the date is not null such as :

  8. Microsoft SQL: CASE WHEN vs ISNULL/NULLIF - Stack Overflow

    Nov 3, 2009 · To answer the titled question: NULLIF is implemented as a CASE WHEN so it's possible to formulate a CASE WHEN that performs identically in both timing and results. ISNULL however is …

  9. SQL - Using CASE statement with multiple IS NULL, IS NOT NULL

    Jul 28, 2021 · I'm having difficulties writing a case statement with multiple IS NULL, NOT NULL conditions. I have the case statement below, however the third condition (WHEN ID IS NOT NULL …

  10. sql - Oracle case when NOT null? - Stack Overflow

    To add to Alex's answer: The CASE expression has two forms, the "simple" CASE expression and the "searched" CASE expression. In a "simple" CASE expression you compare one expression to one or …