I have two tables:
tblA
===============
CustNbr int
SeqNbr int
Field1 varchar
Field2 varchar
tblB
================
CustNbr int
SeqNbr int
FieldX varchar
I want to update Field2 in tblA with the values from FieldX in tblB where tblA.CustNbr=tblB.CustNbr and tblA.seqnbr=tblB.seqNbr.
When I try:
update tblA set Field2=(select b.FieldX from tblB b inner join tblA a on b.CustNbr=a.CustNbr and b.SeqNbr=A.SeqNbr)
I get a message saying "subquery returned more than 1 value...". How do I set up my SQL statement to whip successfully do this update?
Thanks!
tblA
===============
CustNbr int
SeqNbr int
Field1 varchar
Field2 varchar
tblB
================
CustNbr int
SeqNbr int
FieldX varchar
I want to update Field2 in tblA with the values from FieldX in tblB where tblA.CustNbr=tblB.CustNbr and tblA.seqnbr=tblB.seqNbr.
When I try:
update tblA set Field2=(select b.FieldX from tblB b inner join tblA a on b.CustNbr=a.CustNbr and b.SeqNbr=A.SeqNbr)
I get a message saying "subquery returned more than 1 value...". How do I set up my SQL statement to whip successfully do this update?
Thanks!