COALESCE('placeholder') vs. 'placeholder'
What's the difference between using COALESCE() function instead of just using the literal by itself to output placeholders?
# This simpler one: SELECT dept_no, dept_name, 'department manager name' AS fake_col FROM departments_dup; # over COALESCE: SELECT dept_no, dept_name, COALESCE('department manager name') AS fake_col FROM departments_dup;
1 answers ( 0 marked as helpful)
Thanks for reaching out.
In this particular case there is no difference.
The COALESCE() function returns the first non-null value in a list. It is usually used with columns and checking if the current column is NULL.
Hope this helps.
Submit an answer
Department_dup cannot be created on mySQL during exercist 13_8 on COALESCE and IFNULL