I have the following sql statement that is working properly.
SELECT * FROM table WHERE name IS NULL ORDER BY date DESC LIMIT 20;
The query basically orders the table on date desc, and selects the 20 last records for which the field ‘name’ is null. The problem is that the query that is retrieved is ordered on date desc. It’s logic of course… But what I would like, is that the ‘output’ is ordered on date asc. Thank you in advance for you replies. Cheers. Marc
Try this:
Note: some SQL dialects require naming the subquery even if that name is not really used, for example: