Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL/PSQL Question
I currently have a query that works, but lacks any elegance. It will
be added to a stored proc that loops though the import_table and
creates a new row or updates in table bob. The problem is the update.
update bob
set field1 = (select data2 from import_table where import_id=1),
field2 = (select data3 from import_table where import_id=1) where import_id = 1;
This would be fine if there were only 2 fields. In some cases there are 50 and which would mean 50 subqueries. Ackk.
Could someone please suggest a better way to do this?
Thanks in advance,
Kim Goldenberg
Received on Tue Apr 30 2002 - 13:19:46 CDT