Something like this should give you the 30 last primary keys
Can you get something like that to work??Code:Select Top 30 PriKeyCol From SomeTable Order by PriKeyCol Desc
Then you put that in a derived query:
This should return the "first" of those 30 primary key values - if you have less then 30 - it should still work.Code:Select Min(Q1.PriKeyCol) From (Select Top 30 PriKeyCol From SomeTable Order by PriKeyCol Desc) as Q1
Then it's as simple as:
Code:Select * From SomeTable Where PriKeyCol>=(Select Min(Q1.PriKeyCol) From (Select Top 30 PriKeyCol From SomeTable Order by PriKeyCol Desc) as Q1)




Reply With Quote