Last active
February 26, 2019 15:27
-
-
Save fordmadox/ebb36454bcbcca6f0dfff5829c948506 to your computer and use it in GitHub Desktop.
Sample ASpace SQL query to get Resource information and their extent statements
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 | |
r.id AS 'resource database id', | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(r.identifier, ',', '.'),'"',''),']',''),'[',''),'.null','') AS 'collection call number', | |
r.title, | |
r.publish, | |
r.repo_id, | |
r.ead_id, | |
r.finding_aid_author, | |
GROUP_CONCAT(DISTINCT extent.number, ' ', ev.value | |
SEPARATOR '; ') AS 'Extent', | |
GROUP_CONCAT(DISTINCT extent.container_summary | |
SEPARATOR '; ') AS 'Additional Extent', | |
GROUP_CONCAT(DISTINCT extent.dimensions | |
SEPARATOR '; ') AS 'Extent Dimensions', | |
GROUP_CONCAT(DISTINCT extent.physical_details | |
SEPARATOR '; ') AS 'Physical Details' | |
FROM | |
resource r | |
LEFT JOIN | |
extent ON extent.resource_id = r.id | |
LEFT JOIN | |
enumeration_value ev ON extent.extent_type_id = ev.id | |
GROUP BY r.id | |
ORDER BY r.ead_id | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment