In MySQL, can I select columns only where something exists?
For example, I have the following query:
select phone, phone2 from jewishyellow.users wh
We can use CASE for setting blank value to some char or String. I am using NA as Default string.
SELECT phone, CASE WHEN phone2 = '' THEN 'NA' END AS phone2 ELSE ISNULL(phone2,0) FROM jewishyellow.users WHERE phone LIKE '813%'