So i've got a query...
whose subquery returns multiple values, which it should. But what i would like it to do is pick from those returned values based on this table:
So, let's say the subquery returned Y00 and W00. It would select the lower number in that table to use in the subquery, Y00 in this case.
Thanks for your help guys,
Chris
Code:
update indirect_customerb b
set (b.class_of_trade) =
(select a.classoftrade
from gpo_memberships a where a.dea = b.industry_id)
Code:
Y00 1
W00 2
Q00 3
Z00 4
T40 5
D00 6
K00 7
M00 8
I00 9
T50 10
O00 11
N00 12
C00 13
L20 14
C10 15
J00 16
L00 17
F71 18
F70 19
H00 20
So, let's say the subquery returned Y00 and W00. It would select the lower number in that table to use in the subquery, Y00 in this case.
Thanks for your help guys,
Chris