"SAM" <saberb@hotmail.comwrote in message
news:5f09267d-5086-4b7e-b945-63dd587167f6@i29g2000prf.googlegroups.com...
Quote:
HI,
I want to know if is possible to update Table1.Col5 from an
Table2.Col3 ??
The Problem is Col1 and Col2 doesn't have a same size.
Exemple of record.
>
Table 1
Col1 Col2 Col3 Col4 Col5
10 4001 F1 1 NULL
10 4001 F1 1 NULL
10 4003 F5 3 NULL
>
>
Table 2
Col1 Col2 Col3
10 4001 S
10 4001 P
10 5009 S
24 4001 P
>
I tried to update T1.Col5 with T2.Col3 by i got this result
I used INNER join Table1 and Table2 on Col1 and Col2.
>
Table 1
Col1 Col2 Col3 Col4 Col5
10 4001 F1 1 S
10 4001 F1 1 S
10 4003 F5 3 NULL
>
Can you help me please.
Thanks in advance.
>
I don't understand what end result you want. Please could you post your
required results together with some explanation. I'd guess:
UPDATE table1
SET col5 =
(SELECT col3
FROM table2
WHERE table2.col1 = table1.col1
AND table2.col2 = table2.col2);
--
David Portas