Created
November 26, 2008 16:51
-
-
Save madrobby/29443 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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