order by case if not null sql server code example
Example: sql server order by nulls last
SELECT *FROM creditCardORDER BY CASE WHEN monthlyLimit IS NULL THEN 1 ELSE 0 END DESC, monthlyLimit DESC;
SELECT *FROM creditCardORDER BY CASE WHEN monthlyLimit IS NULL THEN 1 ELSE 0 END DESC, monthlyLimit DESC;