I have a mysql table named 'members'.
MEMBERS | member_id, username, email, password, domain_name
email field couldn't be NULL
but domain_name could be.
Here I want to make a SELECT
Query to get username and email or domain_name. If domain_name exist for a particular member_id then I don't need to select email. If not I need to get email.
This is my query I am using at this time. But It select both email and domain.
SELECT email, username, domain_name
FROM members
ORDER BY username DESC;
Can anybody help me to update this select query? Thank You.