Steven, Tuesday, September 24, 2002, 7:03:15 PM, you wrote: SK> I am currently working on a table that has a column called state and a SK> column called stateid. All 42,000 records in this table have a 2 Letter SK> abbreviation for that state (NY, CA, NV, etc) however. To eliminate SK> redundancy, I have move the states to another table that contains an SK> AUTO_INCREMENT field, the state abbr and the state name. A typical SK> record looks like this 1,"NY","New York"
SK> I want to remove the "city.state" column from the and populate the SK> "city.stateid" with values from "state.id" SK> Does anyone have any ideas on how to build an UPDATE statement that SK> will SELECT id FROM state WHERE state = city.state? First multi-table UPDATEs were implemented in 4.0.2 If you use other versions that 4.0.2/4.0.3 you can't do it with single SQL statement. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php