mysql if one field is empty select other field in the same table


Aswathi Valsaraj

SELECT COALESCE( display_name, username ) AS name
FROM register
WHERE register_id =11
AND active =1

if display_name is empty it returns username otherwise returns display_name

View original post