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 -> Re: Trouble joining on composite key

Re: Trouble joining on composite key

From: Mike Burden <mburden_at_uk.att.com>
Date: Wed, 22 Sep 1999 23:58:05 +0100
Message-ID: <37E95EFC.68236BA8@uk.att.com>


Quickly, how about....

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,b1) in
(select tld_order,b1 from frt.tld_data_in b )

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');
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
Received on Wed Sep 22 1999 - 17:58:05 CDT

Original text of this message

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