Start here
Using a CASE Statement in an UPDATE Query in SQL Server
Learn how to use a CASE expression in an UPDATE query in SQL Server to set different values by condition, keep current values, and avoid NULL mistakes.
Writing SQL
CASE WHEN syntax with examples, and how to use it inside UPDATE queries in SQL Server.
Start here
Learn how to use a CASE expression in an UPDATE query in SQL Server to set different values by condition, keep current values, and avoid NULL mistakes.
Learn the basic SQL UPDATE statement with examples: use SET to change column values and WHERE to pick rows, and preview changes before you run one.
Write a CASE expression in a SQL query with WHEN, THEN, ELSE and END. Covers a SELECT example, a simple form, NULL handling and common mistakes to avoid.
See a CASE statement example in SQL: a SELECT that labels rows by condition, how the output looks, and how ELSE and NULL behave in SQL Server.
The CASE WHEN syntax in SQL: the simple and searched forms, the WHEN, THEN, ELSE and END parts, and the rules for NULL and return types, with examples.
Related topics