I'm trying to write a query to update a field in a SQL.7 table with data in another table where the unique identifiers are equal.
I tried doing this in Access and then checking the sql behind the query. The query works but the sql didn't work in SQL.7.
example: UPDATE aos INNER JOIN goodsic ON aos.duns = goodsic.duns SET aos.sic = goodsic.sic
The error I get is invalid syntax near the keyword "Inner".
The other code I tried was:
UPDATE aos
SET aos.sic =
(SELECT goodsic.sic
FROM goodsic INNER JOIN
aos ON goodsic.duns = aos.duns)
The error I get is that the subquery returns more than 1 value.
Can someone please help? I thought I was on the right track, but I'm stuck.
Thanks
Jenn
I tried doing this in Access and then checking the sql behind the query. The query works but the sql didn't work in SQL.7.
example: UPDATE aos INNER JOIN goodsic ON aos.duns = goodsic.duns SET aos.sic = goodsic.sic
The error I get is invalid syntax near the keyword "Inner".
The other code I tried was:
UPDATE aos
SET aos.sic =
(SELECT goodsic.sic
FROM goodsic INNER JOIN
aos ON goodsic.duns = aos.duns)
The error I get is that the subquery returns more than 1 value.
Can someone please help? I thought I was on the right track, but I'm stuck.
Thanks
Jenn