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: TurkBear <john.greco_at_dot.state.mn.us>
Date: Mon, 31 Mar 2003 13:36:18 -0600
Message-ID: <os5h8v4faa3mp4s7ro4gmiim8322lhv9ds@4ax.com>

Why use DUAL...It just add a layer of complexity. Su Man's method will work fine..



SQL> select job_cd,max(empl_stat_cd) from hr_cur_rptng   2 where job_cd in ('000361','000919')   3 group by job_cd;

JOB_CD M
------ -
000361 T
000919 T


andrewst_at_onetel.net.uk (Tony) wrote:

>l.ray_at_bigfoot.com (L.Ray) wrote in message news:<c198b469.0303302159.48f1d7dc_at_posting.google.com>...
>> 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;
>>
>> If anyone could shine some light on how to do this, it would be appreciated.
>
>You almost had it:
>
>select (select max(status) from tickets where location = 'NY'),
> (select max(status) from tickets where location = 'NJ')
>FROM DUAL; -- not FROM tickets

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- Received on Mon Mar 31 2003 - 13:36:18 CST

Original text of this message

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