Created
May 25, 2012 09:28
-
-
Save olegwtf/2786950 to your computer and use it in GitHub Desktop.
Select (group by)
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 collection.uid, orgs.name, | |
group_concat(ifnull(attributes.name,"") separator "\0"), | |
group_concat(ifnull(collection.value,"") separator "\0"), | |
group_concat(ifnull(variants.value,"") separator "\0") | |
from collection | |
left join orgs on orgs.uid=collection.uid | |
left join variants on collection.variant=variants.id | |
left join attributes on collection.attr_id=attributes.id | |
where orgs.proj_id = ? | |
group by collection.uid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment