COALESCE for missing phone
SQL
Easy
3 views
Problem Description
Show customer_id and phone, but display 'NA' when phone is null.
Sample Test Case
Input:
Customers(customer_id, phone)
Official Solution
SELECT customer_id, COALESCE(phone, 'NA') AS phone_display FROM Customers;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!