Non-recursive subquery: top-n
BigQuery
Db2 (LUW)
DuckDB
H2
MariaDB
MySQL
Oracle DB
PostgreSQL
SQL Server
SQLite
2007
2009
2011
2013
2015
2017
2019
2021
2023
✓ 3.8.3 - 3.51.0
⊘ 3.5.7 - 3.7.11
⊘ 2008R2 - 2025
a
✓ 8.4 - 18
⊘ 8.3
✓ 12cR1 - 23.26.0
a
⊘ 11gR2
a
⊘ 11gR1
✓ 8.0.16 - 9.5.0
a
⊘ 8.0.12 - 8.0.14
a
✓ 8.0.11
⊘ 5.0 - 5.7
✓ 10.2 - 12.1.2
⊘ 5.1 - 10.1
✓ 1.4.199 - 2.4.240
⊘ 1.4.191
✓ 1.0.0 - 1.4.0
✓ 9.7 - 12.1.2
✓ 2.0
⊘ 2.0
Workaround: use
row_number() over()
to implement top-N query