Can someone post an example of how to limit the number of rows retrieved, not sure what the command is (LIMIT, TOP etc). Needs to be ANSI SQL.
Thanks!
QueryMan
SELECT TOP 50 PERCENT salary FROM emp ORDER BY salary DESC -- Just trying to help...
<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
queryman, you can't do it in ansi sql unless you give a column to sort on, and then it becomes a variation of the "top ten" query (which, by the way, is not very efficient):
SELECT PERSON, SCORE
FROM SAMPLETABLE XXX
WHERE 10 >
( SELECT COUNT(*)
FROM SAMPLETABLE
WHERE SCORE > XXX.SCORE )
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.