Skip to content
Advertisement

Replacing case with IIF in SQL Server

So for my above query, I want to use IIF instead of CASE, because I want to show only uninsured patients, would something be correct? Because if I only use one case in my case scenario, the null will should up in my insurancestatus column instead of uninsured.

Basically I just want the result for null showing up in result, excluding not null

Advertisement

Answer

This query is equivalent to the one posted except it returns ‘uninsured’ in all FALSE cases. insurancestatus will not be NULL

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement