
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).
sql - Case in Select Statement - Stack Overflow
Jan 7, 2013 · I have an SQL statement that has a CASE from SELECT and I just can't get it right. Can you guys show me an example of CASE where the cases are the conditions and the …
Best way to do nested case statement logic in SQL Server
244 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 …
CASE .. WHEN expression in Oracle SQL - Stack Overflow
select case -- you're only interested in the first character. when 'a' then 'Active' when 'i' then 'Inactive' when 't' then 'Terminated' end as from However, there's a few worrying things about …
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.
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 …
SQL Switch/Case in 'where' clause - Stack Overflow
Oct 16, 2008 · In SQL the rest of the expression does get evaluated in the OR syntax. Try this (it wouldn't let me include the @ symbol - you will have to correct it if you want to test it): declare …
using sql count in a case statement - Stack Overflow
Aug 29, 2015 · using sql count in a case statement Asked 12 years, 6 months ago Modified 1 year, 5 months ago Viewed 548k times
T-SQL: Using a CASE in an UPDATE statement to update certain …
T-SQL: Using a CASE in an UPDATE statement to update certain columns depending on a condition Asked 15 years ago Modified 3 years, 8 months ago Viewed 408k times
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 …