[TriLUG] SQL-fu help request

Igor Partola via TriLUG trilug at trilug.org
Mon Feb 23 14:59:48 EST 2015


Just so I understand you correctly, you have something like this:

CREATE TABLE entries (id int PRIMARY KEY auto_increment, status
varchar(16), created_on timestamp, closed_on timestamp);

SELECT * FROM entries ORDER BY status DESC, created_on LIMIT 10 OFFSET 0;

If that's the case, I would expect the behavior to be correct here. Is
there a chance you are actually running a different query when there is no
page size? Are you by chance forgetting to do `status DESC` since CLOSED <
OPEN when sorted alphabetically?

Igor


More information about the TriLUG mailing list