Skip to content

Instantly share code, notes, and snippets.

@madrobby madrobby/gist:29443
Created Nov 26, 2008

Embed
What would you like to do?
sqlite> SELECT * FROM ENTRIES_TAGS WHERE TAG_ID IN (58, 59);
140|58
141|59
142|58
142|59
sqlite> SELECT DISTINCT ENTRIES.ID FROM ENTRIES INNER JOIN ENTRIES_TAGS ON (ENTRIES.ID = ENTRIES_TAGS.ENTRY_ID) WHERE ENTRIES_TAGS.TAG_ID = 59 INTERSECT SELECT DISTINCT ENTRIES.ID FROM ENTRIES INNER JOIN ENTRIES_TAGS ON (ENTRIES.ID = ENTRIES_TAGS.ENTRY_ID) WHERE ENTRIES_TAGS.TAG_ID = 58;
142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.