#43441 - 23/10/200115:42Re: Way OT: any SQL gurus here?
[Re: SpiceBoy]
eternalsun Pooh-Bah
Registered: 09/09/1999
Posts: 1721
Loc: San Jose, CA
Yep. A big part of the answer to this is "it depends" on the database.
But one reasonable (arguably) way to do top 10 is to select into a temp table with an autonumbering column. Then you follow it with a second select for column<=10. You can incorporate this functionality into a proc, and it's in theory ugly but in practice quite fast.