Unix Technical Forum

Using CASE and TOP statements - HELP

This is a discussion on Using CASE and TOP statements - HELP within the SQL Server Data Warehousing forums, part of the Microsoft SQL Server category; --> Hi, If i use Case in a query, is there a way to retrieve the top, lets say, 10 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server Data Warehousing

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:23 PM
Ali
 
Posts: n/a
Default Using CASE and TOP statements - HELP

Hi,

If i use Case in a query, is there a way to retrieve the top, lets say, 10
for each case within the same query, instead of making different select
statements for each case scenario?

Hence, if i have 3 Cases in the Query, i should have three Top 10's for each
Case?

Will appreciate any help,

Thanks,

Ali


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:23 PM
Adam Machanic
 
Posts: n/a
Default Re: Using CASE and TOP statements - HELP

Can you post DDL, sample data, and the output you want based on the DDL and
sample data?

http://www.aspfaq.com/etiquette.asp?id=5006


--
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--


"Ali" <aliasgerj@hotmail.com> wrote in message
news:%23uDNjdmOFHA.3144@tk2msftngp13.phx.gbl...
> Hi,
>
> If i use Case in a query, is there a way to retrieve the top, lets say, 10
> for each case within the same query, instead of making different select
> statements for each case scenario?
>
> Hence, if i have 3 Cases in the Query, i should have three Top 10's for

each
> Case?
>
> Will appreciate any help,
>
> Thanks,
>
> Ali
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com