Created
January 23, 2019 14:38
-
-
Save marcmartino/c758f889b1a41d7b60f94be3e4d10e62 to your computer and use it in GitHub Desktop.
scripts for getting the next list items
This file contains 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 | |
Asses.id, | |
Groups.orderNum, | |
Defs.phrase, Defs.definition AS translation, | |
Items.phrase, Items.translation | |
FROM WordGroups AS Groups | |
INNER JOIN WordListAssignments AS Asses | |
ON Groups.id = Asses.wordGroupId | |
AND Groups.wordListId = 1 | |
INNER JOIN WordListItems AS Items | |
ON Asses.wordListItemId = Items.id | |
LEFT JOIN Definitions AS Defs | |
ON Defs.id = Items.definitionId | |
ORDER BY Groups.orderNum ASC, Asses.id ASC; | |
LIMIT 2, 5; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment