update query [message #4384] |
Wed, 04 December 2002 08:31 |
Jay
Messages: 127 Registered: October 1999
|
Senior Member |
|
|
I am trying to update the zip field in table1 using the city field from table2 to match up with the city field in table1. When I run the query, I get an error message that says "a subquery returned not exactly one row." I have come to the conclusion that because some cities have multiple zip codes, it doesn't know which zip code to use. Is there anyway around this? I don't care which zip code it uses, just as long as it's one for the correct city.
update act
set zip = (select distinct zip from spk_city
where spk_city.city = act.city)
where state = "IA"
and zip is null
Thanks in advance
|
|
|
|