Quantcast
Viewing all articles
Browse latest Browse all 16

MS SQL Server / SELECT clause with a CASE expression

In SQL Server, if you have a column which has NULLs and instead of nulls, if you want to display ‘Nothing’, what would you do? The following query SELECT CASE Dept_Name WHEN NULL THEN 'Nothing' ELSE Dept_Name END Dept_Name FROM Inventory would still display the nulls and not ‘Nothing’. Workaround: 1> 2> select * from [...] Related posts:
  1. SQL SELECT INTO Statement
  2. Use CAST (or CONVERT) to handle Null Date values in Microsoft SQL Server
  3. How to create an auto-incrementing column in MS SQL Server 2000

Viewing all articles
Browse latest Browse all 16

Trending Articles