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: Help with a select statement

Re: Help with a select statement

From: Su Man <subu501_at_yahoo.com>
Date: Tue, 1 Apr 2003 16:35:13 +0530
Message-ID: <b6brkt$iun$1@news.mch.sbs.de>


Yes, I agree with Tony's point.

If the requirement is to have result in single row, then query should be in Tony's way.

"Tony" <andrewst_at_onetel.net.uk> wrote in message news:c0e3f26e.0304010250.5222e45b_at_posting.google.com...
> TurkBear <john.greco_at_dot.state.mn.us> wrote in message
news:<os5h8v4faa3mp4s7ro4gmiim8322lhv9ds_at_4ax.com>...
> > Why use DUAL...It just add a layer of complexity.
>
> Because the original questioner apparently wanted the result in a
> single row:
>
> > >> I need to do the following, but dont know how:
> > >>
> > >> select (select max(status) from tickets where location = 'NY'),
> > >> (select max(status) from tickets where location = 'NJ')
> > >> FROM tickets;
>
> select (select max(status) from tickets where location = 'NY') NY,
> (select max(status) from tickets where location = 'NJ') NJ
> FROM DUAL;
>
> NY NJ
> -- --
> Z Z
>
> Yes, it's an extra layer of complexity, but if that's the result
> that's wanted, so be it.
Received on Tue Apr 01 2003 - 05:05:13 CST

Original text of this message

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