Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Ultimate Question: Oracle, MSSQL, Others vs MYSQL LIMIT Statement
In regards to SQL Server's ability to do this (ver 2000), there seems
to be two major hurdles.
This statement works just ducky:
SELECT * FROM
(SELECT TOP 10 * FROM
(SELECT TOP 150 * FROM TEMP_ERIC ORDER BY COL1 ASC)
AS T1 ORDER BY COL1 DESC) AS T2 ORDER BY COL1 ASC
But the problem is fairly obvious. You cannot use input paramaters for top values, and as such either have to:
or
c) pass dynamic sql after a string function tweaks things the way you need them.
All three are poor, with c being the only way I can imagine things to work, and that is a horrible alternative.
Anyone have any ideas for item (d)?
And please refrain from making item (d) get mysql! or anything of the sort.
:-) Received on Wed Sep 18 2002 - 14:44:44 CDT
![]() |
![]() |