I have this four table
County(FK is Provicne table id)
District(FK is County table id)
City (FK is District table id)
and I have this table called telcode which I got from excel which contains the province name and the city code and the tel code.
what I am trying to do now is compare my city table cityname with the cityname of the telcode and if it same then put the telcode from the telcode table into my city table. there are cases where I can have two city name in those tables.so I have added one more check i.e. to also check the province names. the telcode table contains more city which I might not have in my city table,so it needs to ignore those,so I have used LEFT OTHER JOIN
here is my query, but when I run the query I get error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
UPDATE city SET telcode = (select telcode.telcode from city
INNER JOIN dbo.district ON city.districtID = district.id
INNER JOIN County ON county.id=district.countyID
INNER JOIN province ON province.id = county.provinceID
LEFT OTHER JOIN telcode ON city.cityname = telcode.city)