Let\'s say I have the following database table:
record_id | record_date | record_value -----------+-------------+-------------- 1 | 2010-05-01 |
This should work:
WITH t AS ( SELECT * FROM mytable ORDER BY record_date DESC LIMIT 5 ) SELECT * FROM t ORDER BY record_date ASC;