Jump to content

SELECT ALL entries, but not the last 10 recent entries.


jasonc

Recommended Posts

First select last 10, then remove them from resultset

 

SELECT * FROM `table`AS t1
LEFT JOIN 
(SELECT ID FROM `table` WHERE `user` = 'username' ORDER BY `date` DESC LIMIT 10) AS t2
ON t1.ID = t2.ID
WHERE t2.ID IS NULL AND `user` = 'username' ORDER BY `date`

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.