Is there an ANSI SQL compliant version of SQL SERVER’s SELECT TOP n?
Is there an ANSI SQL compliant version of SQL SERVER’s SELECT TOP n ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ANSI/ISO SQL:2003 introduced windowing functions:
Microsoft SQL Server 2005 and later supports this syntax.
http://msdn.microsoft.com/en-us/library/ms189798(v=sql.90).aspx
ANSI/ISO SQL:2008 introduced a simpler syntax for
FETCH FIRST, which may be more analogous to Microsoft/SybaseTOPsyntax:Microsoft SQL Server 2012 and later supports this syntax.
https://learn.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-2017#using-offset-and-fetch-to-limit-the-rows-returned
If you’re still using Microsoft SQL Server 2000, you should read a question I posted a while back about doing "paging" style queries:
Emulate MySQL LIMIT clause in Microsoft SQL Server 2000