Created
June 22, 2017 12:11
-
-
Save kashcode/88ad601145ab9283d4976c14e81e2354 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
t.* | |
FROM | |
tweets AS t | |
JOIN ( | |
SELECT | |
tweet_id | |
FROM | |
tweets | |
WHERE | |
id = 11618 | |
) AS o ON t.tweet_id = o.tweet_id | |
AND t.id < if((SELECT MAX(ID) FROM tweets limit 1) = 11618, 11618 + 1, 11618) | |
OR t.tweet_id < o.tweet_id | |
ORDER BY | |
t.tweet_id DESC, | |
t.id DESC | |
LIMIT | |
10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment