Skip to content

Instantly share code, notes, and snippets.

@b1naryth1ef
Created February 14, 2015 06:49
Show Gist options
  • Save b1naryth1ef/c4b13f452e9089f0852a to your computer and use it in GitHub Desktop.
Save b1naryth1ef/c4b13f452e9089f0852a to your computer and use it in GitHub Desktop.
LOL
SELECT i.id, i.type_id, i.price, i.meta, it.name FROM (SELECT unnest(array_cat(b.items, b.winnings)) AS item_id FROM bets b WHERE b.id=1) b JOIN items i ON id=item_id JOIN itemtypes it ON it.id=i.type_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment