About 51 results
Open links in new tab
  1. SQL Case Expression Syntax? - Stack Overflow

    Aug 7, 2008 · case expression is the correct term as they evaluate to a scalar value (also. in SQL a statement is terminated by the "statement terminator" which is the semi-colon).

  2. sql - Case in Select Statement - Stack Overflow

    Jan 7, 2013 · Using a SELECT statement with a searched CASE expression Within a SELECT statement, the searched CASE expression allows for values to be replaced in the result set based on …

  3. sql - Updating a table with CASE - Stack Overflow

    Dec 14, 2025 · 4 Looks like you're confusing between a case expression and a where clause. Without a where clause, the update statement will effect all the rows in the table. Once you have that in mind, …

  4. SQL Server CASE .. WHEN .. IN statement - Stack Overflow

    May 18, 2011 · On SQL server 2005 I am trying to query this select statement SELECT AlarmEventTransactionTableTable.TxnID, CASE AlarmEventTransactions.DeviceID WHEN …

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

  6. sql - Can I use CASE expressions in a JOIN condition? - Stack Overflow

    The following image is a part of Microsoft SQL Server 2008 R2 System Views. From the image we can see that the relationship between sys.partitions and sys.allocation_units depends on the value of sys.

  7. Best way to do nested case statement logic in SQL Server

    I'm writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions. I'm currently using nested case statements, but its getting messy. Is th...

  8. How do I use T-SQL's Case/When? - Stack Overflow

    Jul 27, 2010 · I have a huge query which uses case/when often. Now I have this SQL here, which does not work. (select case when xyz.something = 1 then 'SOMETEXT' else (select case when …

  9. SQL CASE WHEN with multiple AND and OR - Stack Overflow

    Aug 22, 2018 · Can you please tell me if SQL code below makes sense. I am using multiple ANDs and OR in CASE WHEN. Thanks for your help! SELECT id, period, CASE WHEN state = 'group8' AND …

  10. Is SQL syntax case sensitive? - Stack Overflow

    Sep 30, 2008 · Usually case sensitive table and column names are the default on Linux MySQL and case insensitive used to be the default on Windows, but now the installer asked about this during …