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: Tony <andrewst_at_onetel.net.uk>
Date: 1 Apr 2003 02:50:22 -0800
Message-ID: <c0e3f26e.0304010250.5222e45b@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 - 04:50:22 CST

Original text of this message

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