I have a MySQL table which contains the following two fields (There are others, but they’re irrelevant)
creation_time | object_id
1325384907 | 75b31b2c-78e9-46b9-afc8-6d90c0df2ee6
1325388538 | c87734c9-5109-4956-a1cb-7e719ebb4549
1325430911 | 79fe7f41-4a73-4aa3-b1e4-68be0253d9ab
[...]
What I would like to do is select from the table, ordered by time, all objects after a certain object_id
So the sort of thing I’d want is a query like
SELECT * FROM MYTABLE ORDER BY creation_time ASC WHERE object_id > 'c87734c9-5109-4956-a1cb-7e719ebb4549'
Which should return 1325430911 | 79fe7f41-4a73-4aa3-b1e4-68be0253d9ab (Being the next record after that object ID).
This is for a paging system (I.E. ‘get results after’), the only information we have is the uuid so we can’t just select creation_time > x.
Please be aware of LIMIT 1 because if subquery returns more than 1 result, the query will be fail