Brug af MySQL/Postgres:
SELECT t.name,
t.price,
t.change
FROM TABLE t
ORDER BY t.change DESC
LIMIT 5
LIMIT
klausul:
Brug af SQL Server:
SELECT TOP 5
t.name,
t.price,
t.change
FROM TABLE t
ORDER BY t.change DESC
TOP
er understøttet på mindst SQL Server 2000+
Oracle:
SELECT x.*
FROM (SELECT t.name,
t.price,
t.change
FROM TABLE t
ORDER BY t.change DESC) x
WHERE ROWNUM <= 5
Oracles ROWNUM