[Check Point 12.1] Simple Queries in SQL – Chapter 12 Sumita Arora
Table of Contents
10. Which function is used to substitute NULL
values in a query result?
Solution: The “COALESCE
” function is used to substitute NULL values in a query result. Though, in MySQL, both the “COALESCE
” and “IFNULL
” functions can be used to substitute NULL
values in a query result.
Both functions work in MySQL and serve the same purpose of handling NULL
values in query results. However, “COALESCE
” is more versatile as it can handle multiple arguments, while “IFNULL
” is simpler and specifically designed for handling NULL
values.