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 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 Link to comment https://forums.phpfreaks.com/topic/231369-update-field/#findComment-1192338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.