select top nRows from <tableName> 형태의 쿼리는 여러 데이터베이스에서 유사한 방법으로 제공하고 있다.
누군가 잘 정리해 둔 내용이 있어 여기에 옮겨 본다.
Standard |
- Using
FETCH FIRST :(since SQL:2008)
Non-core feature IDs F856, F857, F858, and F859 describe using
SELECT ... FROM ... WHERE ... ORDER BY ... FETCH FIRST n ROWS ONLY
You may write ROW instead of ROWS .
|
InterSystems Ensemble DB(Caché),
MS SQLServer
|
SELECT TOP n columns
FROM tablename
ORDER BY key ASC
|
Oracle |
SELECT * FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY key ASC) AS rownumber,
columns
FROM tablename
)
WHERE rownumber <= n
|
MySQL |
SELECT columns
FROM tablename
ORDER BY key ASC
LIMIT n
|
Informix |
SELECT FIRST n columns
FROM tablename
ORDER BY key ASC
|
|