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

    Jun 13, 2021 · 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). – Paul …

  2. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · The CASE expression cannot be used to control the flow of execution of Transact-SQL statements, statement blocks, user-defined functions, and stored procedures. If your …

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

  4. How to use If condition inside a Case statement?

    Feb 29, 2012 · SQL> select case when value in (1000) then null 2 when user in ('ABC') then user 3 when area in ('DENVER') then 4 if value = 2000 then 'Service1' 5 else value = 3000 then …

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

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

    Jul 27, 2010 · As soon as a WHEN statement is true the break is implicit. You will have to concider which WHEN Expression is the most likely to happen. If you put that WHEN at the …

  7. Case When expression for Dates in SQL Query - Stack Overflow

    First, your CASE statement does not look right. It should be something like CASE WHEN condition THEN value ELSE value END (see SQLite Expressions ). Second, because SQLite …

  8. sql - Case statement with 'OR' statement - Stack Overflow

    Oct 25, 2012 · CASE WHEN ProductLine like '[Rr]' THEN 'Road' WHEN ProductLine like '[Mm]' THEN 'Mountain' Note that in SQL, string comparison is case-insensitive by default. You can …

  9. sql server 2008 - SQL CASE statement with OR? - Stack Overflow

    May 20, 2014 · There are two forms of CASE expression, 'searched' and 'simple'. You can't use an OR with a 'simple' CASE expression, but you can with the 'searched' form: Case When …

  10. How do I do multiple CASE WHEN conditions using SQL Server …

    something like this, two conditions two columns. select itemsreq.item as item, itemsreq.cantidad as cantidad, (case when itemsreq.itemaprobado=1 then 'aprobado' when …

Refresh