Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trouble joining on composite key
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')
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
![]() |
![]() |