in reply to (OT) MySQL query to limit and sort
(old one here for historical purposes):SELECT id, total FROM some_table WHERE id > (SELECT MAX(id) FROM some_table) - 10 ORDER BY total DESC
SELECT id, total FROM some_table WHERE id > (SELECT MAX(id) - 10) ORDER BY total DESC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: (OT) MySQL query to limit and sort
by Anonymous Monk on Feb 03, 2006 at 22:40 UTC | |
by saberworks (Curate) on Feb 03, 2006 at 22:47 UTC | |
by rhesa (Vicar) on Feb 03, 2006 at 23:01 UTC |