Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

sql-porting-problem oracle to postgresql with UPDATE/IS NOT NULL



hello list, 
i have some problems with an sql-statement which runs on oracle but not on
postgresql (i want update only if result of SELECT is not empty, the
SELECT-queries are identical):

UPDATE table1 t1 
	SET (t1.id) = 
		(SELECT h.id FROM table2 t2,table3 t3, table1 t1 
		WHERE t3.field = t2.field 
			AND t2.id = t1.id 
			AND t1.id <> t3.id) 
	WHERE 
		(SELECT h.id FROM table2 t2,table3 t3, table1 t1 
			WHERE t3.field = t2.field 
				AND t2.id = t1.id 
				AND t1.id <> t3.id) IS NOT NULL; 



thanks, hans 





Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group