-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsync_test.sql
More file actions
35 lines (35 loc) · 790 Bytes
/
sync_test.sql
File metadata and controls
35 lines (35 loc) · 790 Bytes
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
select
ss.Site as Site,
ss.SH as GocdbSubmitHost,
ss.Year as Year,
ss.Month as Month,
ss.NJ as GocJobCount,
sr.NJ as LocalJobCount,
sr.NJ - ss.NJ as Difference
from (
select
Site,
SUBSTRING_INDEX( SUBSTRING_INDEX( SUBSTRING_INDEX(SubmitHost, '://', -1) , ':', 1) , '/', 1) as SH,
Year,
Month,
sum(NumberOfJobs) as NJ
from VSuperSummaries
group by 1,2,3,4
having
SH not like 'EMI2%'
and SH not like 'None')
as ss
join (
select
Site,
SUBSTRING_INDEX( SUBSTRING_INDEX( SUBSTRING_INDEX(SubmitHost, '://', -1) , ':', 1) , '/', 1) as SH,
Year,
Month,
sum(NumberOfJobs) as NJ
from VSyncRecords
group by 1,2,3,4
having
SH not like 'EMI2%'
and SH not like 'None')
as sr
using (Site, SH, Year, Month);