[thelist] A Little Query Question
Peter Brunone (EasyListBox.com)
peter at easylistbox.com
Fri Dec 2 17:11:33 CST 2005
Yeah, that's kind of what I was thinking in the first place,
though what I gave you was pretty worthless :)
You'd probably be better off going with some variation of the
other idea I posted (I'm sure it's coming through eventually) or just
caching the whole thing as a DataTable and pulling out sections when you
need them.
Cheers,
Peter
-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Casey
How about this:
SELECT TOP 10 FROM (SELECT TOP 20 field1, field2 FROM table1) ORDER BY
keyID
DESC
The sub query selects the top 20. Then the top query selects the top
10 from the sub set, but orders it backwards by the keyID. The keyID
by defenition always gets bigger by each row, so you are bound to get
the last 10 of the top 20. Right?
But, as always I would be open to better ideas.
Thanks!
Casey
More information about the thelist
mailing list