Skip to content

Instantly share code, notes, and snippets.

@gaetanm
Created August 8, 2014 12:33
Show Gist options
  • Save gaetanm/06899e70b8f96efcb6a5 to your computer and use it in GitHub Desktop.
Save gaetanm/06899e70b8f96efcb6a5 to your computer and use it in GitHub Desktop.
The worst query atm
SELECT item.item0 FROM
(SELECT item0 FROM situationalItems WHERE type = 1
AND build IN (SELECT id FROM build WHERE champion = ? AND mode = ? AND role = ? AND position = ?) UNION ALL
SELECT item1 FROM situationalItems WHERE type = 1
AND build IN (SELECT id FROM build WHERE champion = ? AND mode = ? AND role = ? AND position = ?) UNION ALL
SELECT item2 FROM situationalItems WHERE type = 1
AND build IN (SELECT id FROM build WHERE champion = ? AND mode = ? AND role = ? AND position = ?))
AS item GROUP BY item.item0 ORDER BY COUNT(*) DESC LIMIT 3
@Raphy
Copy link

Raphy commented Aug 8, 2014

Holy shit !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment