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

Home -> Community -> Usenet -> c.d.o.misc -> Trouble joining on composite key

Trouble joining on composite key

From: Andy <abruskoNOzeSPAM_at_binney-smith.com>
Date: Wed, 22 Sep 1999 12:03:38 -0700
Message-ID: <01906254.02f61fde@usw-ex0108-060.remarq.com>


Hi,

I am not sure how to update a table by joining to another table when the key is a composite key. In my situation, my composite key is on the columns: frt_order, bl and accessorial_rc.
The following query returns the message: ERROR at line 11:
ORA-01427: single-row subquery returns more than one row

The query is below...can anyone please tell me how to have write this correctly...appreciate it...thanks!

Update Frt.Freight a

   Set batch =

      (Select comments from Frt.tld_data_in b
       where a.frt_order = b.tld_order and 
             a.bl = b.bl and
             a.accessorial_rc = 'DL')

where a.frt_order =
(select tld_order from frt.tld_data_in b
 where a.frt_order = b.tld_order) and
a.bl =
(select bl from frt.tld_data_in b

 where a.bl = b.bl) and
(a.accessorial_rc = 'DL');
Received on Wed Sep 22 1999 - 14:03:38 CDT

Original text of this message

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