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

php - multilevel menu with multilevel array -

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

objective c - iPhone and it's wireless area -