About 1,500,000 results
Open links in new tab
  1. sql - CASE Statement using IS NULL and IS NOT NULL - Stack Overflow

    Jan 27, 2017 · You can use nullif (col,'') to return null when the value of the first parameter is equal to the second parameter. Can also be simplified to: It's quite possible that the data is …

  2. sql server - CASE statement with IS NULL and NOT NULL

    Jul 11, 2012 · 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,

  3. SQL IS NULL and SQL IS NOT NULL Examples - MSSQLTips.com - SQL

    Nov 15, 2024 · This article looks at how to use SQL IS NULL and SQL IS NOT NULL operations in SQL Server along with use cases and working with NULL values.

  4. SQL CASE Expression - W3Schools

    If no conditions are true, it returns the value in the ELSE clause. If there is no ELSE part and no conditions are true, it returns NULL. Below is a selection from the "OrderDetails" table in the …

  5. Handling NULL Conditions Using CASE Statements in SQL

    When using CASE statements to handle NULLs, the following best practices are recommended: Always use proper aliases to make your SQL queries more readable. Use IS NULL and IS …

  6. ISNULL in a CASE statement??? - SQLServerCentral

    Jan 21, 2008 · I want to know how to detect for NULL in a CASE statement. I know logically I can exclude the 'when null...' line as it will be captured by the ELSE statement.

  7. How to Use the SQL CASE Statement – with Example Challenge

    Nov 4, 2022 · We'll use the CASE statement we learned to add conditionals for when the ManagerId is not null and to check if the ManagerId also exists. The first thing we need to do is …

  8. Handling NULL Values in SQL CASE Statements: A

    Oct 30, 2023 · Take care when comparing NULL values – use IS NULL/IS NOT NULL for clarity. Format CASE statements neatly and break into nested/modular chunks when needed. Only …

  9. Using a Case Statement With IS NULL and IS NOT NULL

    Jun 5, 2021 · When the value is not null, I get 'was null', and when actually is null, I get an actual MYSQL NULL value. What I want is that when userName is null, return 'was null' and when …

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

    Aug 1, 2017 · However, my CASE expression needs to check if a field IS NULL. If the @UserRole variable value = 'Analyst', then the SupervisorApprovedBy column value must be NULL. …

  11. Some results have been removed
Refresh