Created
August 14, 2015 05:34
-
-
Save gautiermichelin/930492cbbbb7997204a3 to your computer and use it in GitHub Desktop.
CollectiveAccess SQL request : used list items inside object records
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
SELECT ca_list_labels.list_id, | |
ca_list_labels.`name`, | |
ca_attribute_values.item_id, | |
ca_list_item_labels.name_singular, | |
group_concat(distinct ca_attributes.row_id) as objets | |
FROM ca_list_labels LEFT OUTER JOIN ca_lists ON ca_list_labels.list_id = ca_lists.list_id | |
LEFT OUTER JOIN ca_list_items ON ca_lists.list_id = ca_list_items.list_id | |
LEFT OUTER JOIN ca_attribute_values ON ca_list_items.item_id = ca_attribute_values.item_id | |
LEFT OUTER JOIN ca_list_item_labels ON ca_list_item_labels.item_id = ca_attribute_values.item_id | |
LEFT OUTER JOIN ca_attributes ON ca_attribute_values.attribute_id = ca_attributes.attribute_id | |
WHERE table_num = 57 | |
GROUP BY ca_attribute_values.item_id | |
ORDER BY list_id, name_singular ASC |
Author
gautiermichelin
commented
Aug 14, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment