Created
May 18, 2014 16:16
-
-
Save GaretJax/1eb9b73d37e8dc6203fd 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 p.id as publication, count(distinct a.id) as authors, i.country, p.year | |
| from affiliated_author as a | |
| join publication as p on p.id = a.publication_id | |
| join institution as i on i.id = a.institution_id | |
| where a.publication_id in ( | |
| -- Publications with any author from Kuwait published on or before 2005 | |
| select distinct p.id | |
| from publication as p | |
| join affiliated_author as a on a.publication_id = p.id | |
| join institution as i on a.institution_id = i.id | |
| where i.country = 'Kuwait' and p.year <= 2005 | |
| ) | |
| group by i.country, p.id, p.year | |
| order by p.year; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment