Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netezza UPDATE from one table to another

This is my query that does not work in Netezza:

UPDATE TABLE1 A
SET A.COL1= (SELECT DISTINCT B.COL1 FROM TABLE2 B WHERE B.ID= A.ID AND B.DeptID=104)
WHERE A.DeptID=3

How do I re-write this query? Please help.

like image 787
Ram Avatar asked Aug 06 '14 16:08

Ram


1 Answers

UPDATE TABLE1 A
SET A.COL1 = B.COL1
FROM TABLE2 B
WHERE
A.ID = B.ID AND 
A.DeptID = 3 AND 
B.DeptID = 104;
like image 104
Donal Avatar answered Oct 13 '22 00:10

Donal