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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| ||||
| 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 > > |