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

Instruction

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

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

Let's give it a go.

Exercise

Second time success! 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').