Använda MySQL/Postgres:
SELECT t.name,
t.price,
t.change
FROM TABLE t
ORDER BY t.change DESC
LIMIT 5
LIMIT
klausul:
Använda SQL Server:
SELECT TOP 5
t.name,
t.price,
t.change
FROM TABLE t
ORDER BY t.change DESC
TOP
stöds på åtminstone 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