DBrewsky Posted September 15, 2007 Share Posted September 15, 2007 I am trying to change the data in one field based upon data in another field.. mysql > REPLACE INTO zip (state_lg) VALUES ('ARIZONA') WHERE state='AZ'; Basically I am trying to replace a NULL data in one field where data in another field of the same table is equal to a certain value. Is there an easy way to do this, or will I need to extract the data then make the REPLACE statement. I am a newb at this and any help would be appreciative. DBrewsky Quote Link to comment Share on other sites More sharing options...
DBrewsky Posted September 15, 2007 Author Share Posted September 15, 2007 UPDATE [table_name] SET [field_name1] = [data1] WHERE [field_name2] = [data2]; This worked beautifully!!! If someone needs a database of all the zip codes, the state, city and county, let me know.. Just got one done.. First real database (52,000 records) I have created... Now how to use all that info... :-\ Quote Link to comment 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.