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: any bright ideas

Re: any bright ideas

From: Rohrbacher <rohbo_at_freebee.tu-graz.ac.at>
Date: 1997/04/18
Message-ID: <3357D1F8.7EA@freebee.tu-graz.ac.at>#1/1

socgen-crosby wrote:
>
> there are three tables x,y and z
> I am trying to achieve following in one update statement
> update z
> set z.a ='O'
> where
> (select count(*) from x) = (select count(*) from y);
>
> I know above sql statement is syntactically wrong but
> is there any way of achieving this in single sql statement
> (without using any explicit cursors)?

What about this :
update z
set z.x = ( select c1.anz - c2.anz

               from ( select count(*)  anz  from standort ) c1 ,
	            ( select count(*)  anz  from standort ) c2 
            ); 

I hope its worth reading.

Ciao. Robo. Received on Fri Apr 18 1997 - 00:00:00 CDT

Original text of this message

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