Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Comparisons with NULL
Functions with NULL
COALESCE to the rescue
16. Conversion for COALESCE
Revision and practice


Good. COALESCE failed, as you can see. How can we cope with it? We can always convert any type to varchar:

COALESCE(CAST(price AS varchar),'--');

Let's give it a go.


Second time lucky! Modify the template to select the product name and launch_date. Show 'no date' when there is no launch_date. Add CAST so that COALESCE works properly.

Stuck? Here's a hint!

Use COALESCE(CAST(launch_date AS varchar), 'no date').