Last active
November 12, 2018 16:13
-
-
Save meau/acdd42b29d726daa47e70b6133bd0559 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
SELECT | |
COUNT(DISTINCT accession.id) | |
FROM | |
accession | |
JOIN | |
linked_agents_rlshp ON linked_agents_rlshp.accession_id = accession.id | |
LEFT JOIN | |
agent_person ON linked_agents_rlshp.agent_person_id = agent_person.id | |
LEFT JOIN | |
agent_corporate_entity ON linked_agents_rlshp.agent_corporate_entity_id = agent_corporate_entity.id | |
LEFT JOIN | |
name_person ON name_person.agent_person_id = agent_person.id | |
LEFT JOIN | |
name_corporate_entity ON name_corporate_entity.agent_corporate_entity_id = agent_corporate_entity.id | |
LEFT JOIN | |
enumeration_value evrole ON linked_agents_rlshp.role_id = evrole.id | |
WHERE | |
evrole.value = 'source'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment