RE: newbie sql question .....NESTED QUERY

RE: newbie sql question .....NESTED QUERY

 

  

thanks very much

-----Original Message-----
From: [Email Address Removed] [mailto:[Email Address Removed] Wednesday, May 22, 2002 10:58 AM
To: Conahan, Patrick
Cc: '[Email Address Removed] Re: newbie sql question .....NESTED QUERY




Search BOL for subqueries instead of nested queries. It's all there.






"Conahan, Patrick" <Patrick.[Email Address Removed] on 05/22/2002 11:47:54 AM

To: "'[Email Address Removed] <[Email Address Removed] newbie sql question .....NESTED QUERY


Is there any way to do a nested query like:

SELECT CLB_RUN, COUNT(*) FROM
(SELECT CLAIM, MAX(CLB_RUN) FROM INF_CLAIM_BATCH
GROUP BY CLAIM)
GROUP BY CLB_RUN

I've been doing the 'SELECT CLAIM, MAX(CLB_RUN) FROM INF_CLAIM_BATCH' first
and creating a temp table, then doing the query off of that, but certainly
it would be more convenient to do it this way. I looked up nested query in
books online and found nothing

Patrick Conahan
Consultant



---------------------------------------------------------------------
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page