Skip to content

Coalesce

Mathias Rangel Wulff edited this page Jun 12, 2015 · 2 revisions

Keyword COALESCE

Show first NON NULL and non-NaN parameter:

    SELECT CAST(COALESCE(hourly_wage * 40 * 52, 
        salary, 
        commission * num_sales) AS money) AS [Total Salary]
    FROM wages
    ORDER BY [Total Salary];

See the working example in jsFiddle.

Clone this wiki locally