Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
KidSQL
Yak Posting Veteran
88 Posts |
Posted - 2005-04-14 : 15:59:28
|
| I've got a table with the following columnsDate Item ValueJan-96 abc 4Jan-96 def 3Jan-96 xyz 5Feb-96 (etc)with historical records of values per Item on a monthly basis. Can anyone tell me how I would return, say, the top 1000 values per month from this table?Thanks in advance to anyone wiling to help. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-04-14 : 16:58:03
|
How about this?select [date] ,[value]from myTable aWhere value in ( select top 1000 value from myTable where [date] = a.[date] order by value desc ) Be One with the OptimizerTG |
 |
|
|
|
|
|