sirtemplar Posted March 22, 2011 Share Posted March 22, 2011 hi. i have a table called "houses" with several felds. what i want is an SQL statement to write on "field 2" the word YES if "field 1" is not empty. help please Quote Link to comment https://forums.phpfreaks.com/topic/231369-update-field/ Share on other sites More sharing options...
Twitch Posted March 25, 2011 Share Posted March 25, 2011 Should be simple enough if I understand correctly. UPDATE houses SET field_2='YES' WHERE field_1 !='' Or if by empty you mean NULL UPDATE houses SET field_2='YES' WHERE field_1 IS NOT NULL Quote Link to comment https://forums.phpfreaks.com/topic/231369-update-field/#findComment-1192338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.