-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_pubs_german_pillars.sql
51 lines (51 loc) · 1.46 KB
/
create_pubs_german_pillars.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CREATE TABLE pubs_german_pillars_update AS
(SELECT
items.pk_items,
items.ut_eid,
items.doi,
items.doctype,
items.pubyear,
issues.issn,
sec.pk_kb_sectors,
sec.sector,
sec.subsector,
inst.pk_kb_inst,
inst.name as inst_name
FROM
wos_b_2021.items items
INNER JOIN
wos_b_2021.issues issues
ON issues.pk_issues = items.fk_issues
INNER JOIN
wos_b_2021.databasecollection db
ON db.fk_items = items.pk_items
INNER JOIN
wos_b_2021.kb_a_addr_inst a_addr_inst
ON items.pk_items = a_addr_inst.fk_items
AND items.ut_eid = a_addr_inst.ut_eid
INNER JOIN
wos_b_2021.kb_inst inst
ON inst.pk_kb_inst = a_addr_inst.fk_kb_inst
INNER JOIN
wos_b_2021.kb_a_inst_sec a_inst_sec
ON inst.pk_kb_inst = a_inst_sec.fk_kb_inst
INNER JOIN
wos_b_2021.kb_sectors sec
ON sec.pk_kb_sectors = a_inst_sec.fk_kb_sectors
INNER JOIN
wos_b_2021.kb_a_addr_sec a_addr_sec
ON a_addr_sec.fk_kb_a_addr_inst = a_addr_inst.pk_kb_a_addr_inst
AND a_addr_sec.fk_kb_sectors = sec.pk_kb_sectors
WHERE
db.edition_value IN (
'WOS.SCI', 'WOS.SSCI', 'WOS.AHCI'
)
AND items.doctype IN (
'Article', 'Review'
)
AND sec.pk_kb_sectors IN (
3, 4, 6, 7, 8, 9, 10
)
AND items.pubyear > 2009
AND items.pubyear < 2021
);