mySQL return not empty field -


I have two fields, but I just want to return empty-empty one.

  First name, choose last name, (if firstname! = Empty, then first name and last name) names from users;  

How can I go about doing something like the above? I'm not sure what should be inside the round bracket. I do not want to use PHP post processing.

Both the null values ​​along with the empty string ( '' )

  Select IF (LENGTH (first name), first name, last name) as the name from users;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -