Skip to content

Instantly share code, notes, and snippets.

@LarsNieuwenhuizen
Created August 20, 2018 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LarsNieuwenhuizen/16660d15ea8b10e0b9bc0c8ba2e9cb9e to your computer and use it in GitHub Desktop.
Save LarsNieuwenhuizen/16660d15ea8b10e0b9bc0c8ba2e9cb9e to your computer and use it in GitHub Desktop.
Select double key combinations on table
SELECT CP1.*
FROM table CP1
JOIN table CP2
ON CP1.item1_id = CP2.item1_id AND CP1.item2_id = CP2.item2_id AND CP1.id > CP2.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment