Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL/PSQL Question

SQL/PSQL Question

From: Kim Goldenberg <kshorty_at_phat.com>
Date: 30 Apr 2002 11:19:46 -0700
Message-ID: <db0be6d6.0204301019.7476ee0a@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US