Created
October 26, 2015 21:08
-
-
Save rossriley/eeaa42e10b589b746ea0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| SELECT content.*, GROUP_CONCAT(DISTINCT entries.to_id) as entries FROM bolt_showcases content LEFT JOIN bolt_relations entries ON ((content.id = entries.from_id) AND (entries.from_contenttype = :boltname) AND (entries.to_contenttype = :field)) OR ((content.id = entries.to_id) AND (entries.to_contenttype = :boltname) AND (entries.from_contenttype = :field)) GROUP BY content.id | |
| SELECT content.*, GROUP_CONCAT(DISTINCT entries.to_id) as entries FROM bolt_showcases content LEFT JOIN bolt_relations entries ON content.id = entries.from_id AND entries.from_contenttype='showcases' AND entries.to_contenttype='entries' GROUP BY content.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment