Skip to content

Instantly share code, notes, and snippets.

@marcmartino
Created January 23, 2019 14:38
Show Gist options
  • Save marcmartino/c758f889b1a41d7b60f94be3e4d10e62 to your computer and use it in GitHub Desktop.
Save marcmartino/c758f889b1a41d7b60f94be3e4d10e62 to your computer and use it in GitHub Desktop.
scripts for getting the next list items
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