I need to generate a report for top 10 rows for each date in a table. I can write a statment for each date but can anyone help with writitng it in single query;
select top * from Table where date ='2014-01-01';
select top * from Table where date ='2014-02-01';
select top * from Table where date ='2014-03-01';
Looking for any help.
If you need TOP only for SAMPLING (whithout ORDER BY) you could try stratified sampling.
SAMPLE WHEN TheDate = '2014-01-01' THEN 10
WHEN TheDate = '2014-2-01' THEN 10