dbatrainer
asked on
ANSI Compliant keyword for TOP N clause
Need to find ANSI-92 compliant keyword for the TOP (n) keyword used in SQL Server Transact SQL?
use LIMIT in MySQL and maybe others as well.
Which Database are you using??
Jay
Jay
ASKER
comment to JLtoops from dbatrainer.
You're right a subquery would work, but it's resource intensive and I was hoping to find a universal ANSI compliant clause that works the same as TOP (n) for a hetergenous environment including SQL Server 2000, Oracle, Dbase, and others. One that might also allow (with ties).
Thanks for the reply
You're right a subquery would work, but it's resource intensive and I was hoping to find a universal ANSI compliant clause that works the same as TOP (n) for a hetergenous environment including SQL Server 2000, Oracle, Dbase, and others. One that might also allow (with ties).
Thanks for the reply
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
from yourtable X
where ( select count(*)
from yourtable
where foo > X.foo ) < 10
Jay