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
Post a Comment