Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with a select statement
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
![]() |
![]() |