vani
Joined: 12 May 2008 Posts: 179
|
Posted: Mon Aug 31, 2009 6:08 am Post subject: If condition in mysql query |
|
|
Hi,
I faced the problem with the query ,using IF condition in it.
For this,to overcome this problem,below is the code for IF condition in query.
--------------------------------------------------------------------------
SELECT user_username if( user_username != 'NULL', user_username, user_establishment ) FROM users.
--------------------------------------------------------------------------
Above query results,if user_username is not NULL ,it gives the result as content of the "user_username" field or else it gives content of "user_establishment" field.
I hope it helps you more  |
|