Select different field in mysql if a field is set to null? -


I select the displayname as the user name if username = null and if the user name is not null Then select the username as the username. example.

  id user name name 1 xyz null 2 ​​null aBC  

Select how I can do this in a single statement ... Thank you

Collages (user name, vip name) should help you.

Example:

  The user from selected Coleses (Username, Dzemen) where ...  

Comments

Popular posts from this blog

MySql variables and php -

php - Laravel - Overriding a resource route into a different route filter group -

url rewriting - How to implement the returnurl like SO in PHP? -