Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: tricky sql question
On Tue, 27 May 1997 22:30:33 GMT, breitliw_at_netcom.ca (Wolfgang Breitling) wrote:
>Does anyone know a nifty way of writing an update sql where the qualifying
>rows are determined by matching the multicolumn prime key with values
>returned from a subselect. This is one way, but it this way oracle doesn't use
>any indexes:
>
>update tbl_a set some_column = value
>where key1 || key2 in (select key1 || key2 from tbl_b
>where other_column = xyz )
>
how about
update tbl_a set some_column = value
where ( key1, key2 ) in ( select key1, key2 from tbl_b
where other_column = xyz )/
[snip]
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |