Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
The COALESCE() function
5. Data types in COALESCE()
The GREATEST() & LEAST() functions
The NULLIF() function
Summary

Instruction

Excellent! It's good to remember that COALESCE() takes an argument of only one data type. For instance, the following works fine:

SELECT COALESCE(price, 0.00) AS price
FROM product;

The price column is of decimal data type; therefore we replace its 0.00 value which is the same data type. This function will return 0.00 in place of a NULL value in the price column.

Check it out yourself. Try to use the COALESCE() function to show the product name and the launch_date or 'no date' when the date is unknown.

Exercise

Run the template query. When you're done, click I'm done. Next exercise to continue.