Skip to content

Instantly share code, notes, and snippets.

@l15k4
Last active Jul 30, 2020
Embed
What would you like to do?
SELECT "c-geo:c3" AS "country", COUNT(DISTINCT "diid") AS "gwid", "d_site" AS "d_site"
FROM "test"
WHERE
("cid" = 'mjzrq2v' AND ("d_site" = '18975' OR "d_site" = '18969' OR "d_site" = '21034' OR "d_site" = '21032'
OR "d_site" = '21031' OR "d_site" = '21030' OR "d_site" = '18976' OR "d_site" = '20864' OR "d_site" = '19055'
OR "d_site" = '18620' OR "d_site" = '47404' OR "d_site" = '35936' OR "d_site" = '14210' OR "d_site" = '47403'
OR "d_site" = '43607' OR "d_site" = '36407' OR "d_site" = '36025' OR "d_site" = '34227' OR "d_site" = '15596'
OR "d_site" = '56098' OR "d_site" = '15298' OR "d_site" = '14209' OR "d_site" = '22631' OR "d_site" = '29508'
OR "d_site" = '13761' OR "d_site" = '22636' OR "d_site" = '22634' OR "d_site" = '31767' OR "d_site" = '31405'
OR "d_site" = '31495' OR "d_site" = '29222' OR "d_site" = '20933' OR "d_site" = '20164' OR "d_site" = '34271'
OR "d_site" = '24988' OR "d_site" = '24265' OR "d_site" = '20237' OR "d_site" = '20071' OR "d_site" = '40030'
OR "d_site" = '40027' OR "d_site" = '37068' OR "d_site" = '19966' OR "d_site" = '31788' OR "d_site" = '21549'
OR "d_site" = '35072' OR "d_site" = '32483' OR "d_site" = '50471' OR "d_site" = '40627' OR "d_site" = '40851'
OR "d_site" = '42836' OR "d_site" = '38954' OR "d_site" = '41120' OR "d_site" = '42054' OR "d_site" = '42052'
OR "d_site" = '23445' OR "d_site" = '31892' OR "d_site" = '31857' OR "d_site" = '40647' OR "d_site" = '58022'
OR "d_site" = '37317' OR "d_site" = '32122' OR "d_site" = '32392' OR "d_site" = '32388' OR "d_site" = '32387'
OR "d_site" = '32385' OR "d_site" = '37211' OR "d_site" = 'WID' OR "d_site" = '45423' OR "d_site" = '50110'
OR "d_site" = '45420' OR "d_site" = '48342' OR "d_site" = '45169' OR "d_site" = '57090' OR "d_site" = '36874'
OR "d_site" = '41281' OR "d_site" = '45434' OR "d_site" = '50206' OR "d_site" = '45428' OR "d_site" = '50199'
OR "d_site" = '45426' OR "d_site" = '50197' OR "d_site" = '45424' OR "d_site" = '50348' OR "d_site" = '50208'
OR "d_site" = '45438' OR "d_site" = '50207' OR "d_site" = '55797' OR "d_site" = '35102' OR "d_site" = '26866'
OR "d_site" = '49291' OR "d_site" = '30043' OR "d_site" = '52182' OR "d_site" = '31785' OR "d_site" = '32713'
OR "d_site" = '39561' OR "d_site" = '30638' OR "d_site" = '50915' OR "d_site" = '36446' OR "d_site" = '51293'
OR "d_site" = '36573' OR "d_site" = '51694' OR "d_site" = '35096' OR "d_site" = '55512' OR "d_site" = '35097'
OR "d_site" = '55513' OR "d_site" = '35098' OR "d_site" = '55709' OR "d_site" = '36593' OR "d_site" = '53744'
OR "d_site" = '37282' OR "d_site" = '20249' OR "d_site" = '37285' OR "d_site" = '24519' OR "d_site" = '37296'
OR "d_site" = '31006' OR "d_site" = '38099' OR "d_site" = '45153' OR "d_site" = '38100' OR "d_site" = '21126'
OR "d_site" = '36582' OR "d_site" = '52613' OR "d_site" = '36583' OR "d_site" = '52614' OR "d_site" = '36584'
OR "d_site" = '52616' OR "d_site" = '36591' OR "d_site" = '25785' OR "d_site" = '25786' OR "d_site" = '25789'
OR "d_site" = '25790' OR "d_site" = '25791' OR "d_site" = '29420' OR "d_site" = '18603' OR "d_site" = '20216'
OR "d_site" = '25784' OR "d_site" = '37434' OR "d_site" = '43219' OR "d_site" = '43220' OR "d_site" = '36541'
OR "d_site" = '36114' OR "d_site" = '35091' OR "d_site" = '35092' OR "d_site" = '35094' OR "d_site" = '35095'
OR "d_site" = '20808' OR "d_site" = '21008' OR "d_site" = '51449' OR "d_site" = '57068' OR "d_site" = '30607'
OR "d_site" = '42188' OR "d_site" = '51450' OR "d_site" = '57071' OR "d_site" = '30609' OR "d_site" = '42189'
OR "d_site" = '51451' OR "d_site" = '33279' OR "d_site" = '30611' OR "d_site" = '42360' OR "d_site" = '51452'
OR "d_site" = '57206' OR "d_site" = '30617' OR "d_site" = '18546' OR "d_site" = '38555' OR "d_site" = '20076'
OR "d_site" = '52216' OR "d_site" = '52010' OR "d_site" = '52217' OR "d_site" = '41343' OR "d_site" = '39507'
OR "d_site" = '55923' OR "d_site" = '51444' OR "d_site" = '41345' OR "d_site" = '13942' OR "d_site" = '21841'
OR "d_site" = '51445' OR "d_site" = '44142' OR "d_site" = '30570' OR "d_site" = '21842' OR "d_site" = '51447'
OR "d_site" = '45883' OR "d_site" = '30580' OR "d_site" = '42178' OR "d_site" = '51448' OR "d_site" = '53655'
OR "d_site" = '30582' OR "d_site" = '42180' OR "d_site" = '31972' OR "d_site" = '45604' OR "d_site" = '44524'
OR "d_site" = '50956' OR "d_site" = '31973' OR "d_site" = '57795' OR "d_site" = '44527' OR "d_site" = '50957'
OR "d_site" = '23382' OR "d_site" = '57797' OR "d_site" = '44530' OR "d_site" = '24449' OR "d_site" = '57826'
OR "d_site" = '24450' OR "d_site" = '42362' OR "d_site" = '30621' OR "d_site" = '42503' OR "d_site" = '41438'
OR "d_site" = '44291' OR "d_site" = '42504' OR "d_site" = '18731' OR "d_site" = '41710' OR "d_site" = '44293'
OR "d_site" = '42505' OR "d_site" = '18916' OR "d_site" = '42959' OR "d_site" = '44294' OR "d_site" = '42509'
OR "d_site" = '19071' OR "d_site" = '56835' OR "d_site" = '44295' OR "d_site" = '42510' OR "d_site" = '28545'
OR "d_site" = '45212' OR "d_site" = '44522' OR "d_site" = '42516' OR "d_site" = '31971' OR "d_site" = '56832'
OR "d_site" = '44523' OR "d_site" = '42517' OR "d_site" = '46529' OR "d_site" = '41447' OR "d_site" = '54375'
OR "d_site" = '29077' OR "d_site" = '41449' OR "d_site" = '21004' OR "d_site" = '29078' OR "d_site" = '41450'
OR "d_site" = '22131' OR "d_site" = '29503' OR "d_site" = '41452' OR "d_site" = '40978' OR "d_site" = '31461'
OR "d_site" = '41453' OR "d_site" = '58628' OR "d_site" = '44958' OR "d_site" = '41454' OR "d_site" = '46994'
OR "d_site" = '43428' OR "d_site" = '22333' OR "d_site" = '43495' OR "d_site" = '46526' OR "d_site" = '21820'
OR "d_site" = '53728' OR "d_site" = '46527' OR "d_site" = '29494' OR "d_site" = '53817' OR "d_site" = '46528'
OR "d_site" = '29496' OR "d_site" = '53960' OR "d_site" = '30715' OR "d_site" = '41466' OR "d_site" = '52209'
OR "d_site" = '30716' OR "d_site" = '41617' OR "d_site" = '52212' OR "d_site" = '35160' OR "d_site" = '51183'
OR "d_site" = '52213' OR "d_site" = '35163' OR "d_site" = '51185' OR "d_site" = '52214' OR "d_site" = '35164'
OR "d_site" = '52009' OR "d_site" = '35165' OR "d_site" = '42704' OR "d_site" = '41456' OR "d_site" = '42705'
OR "d_site" = '50661' OR "d_site" = '41457' OR "d_site" = '42706' OR "d_site" = '30712' OR "d_site" = '41459'
OR "d_site" = '51994' OR "d_site" = '30713' OR "d_site" = '41463' OR "d_site" = '52204' OR "d_site" = '30714'
OR "d_site" = '41464' OR "d_site" = '52207' OR "d_site" = '44359' OR "d_site" = '42349' OR "d_site" = '44674'
OR "d_site" = '28141' OR "d_site" = '15521' OR "d_site" = '29534' OR "d_site" = '18511' OR "d_site" = '15051'
OR "d_site" = '50454' OR "d_site" = '18512' OR "d_site" = '15052' OR "d_site" = '50459' OR "d_site" = '18513'
OR "d_site" = '15515' OR "d_site" = '50461' OR "d_site" = '19083' OR "d_site" = '15516' OR "d_site" = '50462'
OR "d_site" = '20112' OR "d_site" = '15517' OR "d_site" = '50463' OR "d_site" = '20928' OR "d_site" = '15518'
OR "d_site" = '50464' OR "d_site" = '21483' OR "d_site" = '15519' OR "d_site" = '50465' OR "d_site" = '22007'
OR "d_site" = '15520' OR "d_site" = '50467' OR "d_site" = '48177' OR "d_site" = '15522' OR "d_site" = '55254'
OR "d_site" = '50533' OR "d_site" = '15523' OR "d_site" = '15693' OR "d_site" = '36187' OR "d_site" = '21562'
OR "d_site" = '15524' OR "d_site" = '18047' OR "d_site" = '21563' OR "d_site" = '15525' OR "d_site" = '18509'
OR "d_site" = '34296' OR "d_site" = '15526' OR "d_site" = '42999' OR "d_site" = '23038' OR "d_site" = '15527'
OR "d_site" = '47251' OR "d_site" = '28349' OR "d_site" = '25462' OR "d_site" = '18375' OR "d_site" = '30221'
OR "d_site" = '32206' OR "d_site" = '18377' OR "d_site" = '31249' OR "d_site" = '38164' OR "d_site" = '25783'
OR "d_site" = '31517' OR "d_site" = '38420' OR "d_site" = '50975' OR "d_site" = '44643' OR "d_site" = '28522'
OR "d_site" = '26342' OR "d_site" = '41348' OR "d_site" = '44701' OR "d_site" = '31374' OR "d_site" = '26433'
OR "d_site" = '44707' OR "d_site" = '33336' OR "d_site" = '44730' OR "d_site" = '34001' OR "d_site" = '50976'
OR "d_site" = '57828' OR "d_site" = '35804' OR "d_site" = '50977' OR "d_site" = '24451' OR "d_site" = '57831'
OR "d_site" = '34855' OR "d_site" = '50978' OR "d_site" = '24452' OR "d_site" = '58907' OR "d_site" = '19047'
OR "d_site" = '43141' OR "d_site" = '24453' OR "d_site" = '58909' OR "d_site" = '21176' OR "d_site" = '33215'
OR "d_site" = '28688' OR "d_site" = '14705' OR "d_site" = '22600' OR "d_site" = '39036' OR "d_site" = '28715'
OR "d_site" = '22876' OR "d_site" = '23581' OR "d_site" = '40060' OR "d_site" = '44620' OR "d_site" = '26824'
OR "d_site" = '25871' OR "d_site" = '41347' OR "d_site" = '47667' OR "d_site" = '26437' OR "d_site" = '47668'
OR "d_site" = '46329' OR "d_site" = '31151' OR "d_site" = '54368' OR "d_site" = '14511' OR "d_site" = '35375'
OR "d_site" = '15727' OR "d_site" = '40336' OR "d_site" = '26445' OR "d_site" = '47670' OR "d_site" = '48287'
OR "d_site" = '41384' OR "d_site" = '28759' OR "d_site" = '47672' OR "d_site" = '51550' OR "d_site" = '41385'
OR "d_site" = '54539' OR "d_site" = '52595' OR "d_site" = '52399' OR "d_site" = '41386' OR "d_site" = '38604'
OR "d_site" = '54044' OR "d_site" = '38194' OR "d_site" = '14831' OR "d_site" = '41941' OR "d_site" = '15900'
OR "d_site" = '39978' OR "d_site" = '16151' OR "d_site" = '43659' OR "d_site" = '15908' OR "d_site" = '43665'
OR "d_site" = '19873' OR "d_site" = '46330' OR "d_site" = '18705' OR "d_site" = '43666' OR "d_site" = '19914'
OR "d_site" = '43663' OR "d_site" = '25822' OR "d_site" = '15428' OR "d_site" = '15667' OR "d_site" = '15668'
OR "d_site" = '39066' OR "d_site" = '39067' OR "d_site" = '43772' OR "d_site" = '50586' OR "d_site" = '25752'
OR "d_site" = '27958' OR "d_site" = '27961' OR "d_site" = '28007' OR "d_site" = '28235' OR "d_site" = '28238'
OR "d_site" = '28241' OR "d_site" = '28242' OR "d_site" = '28245' OR "d_site" = '33970' OR "d_site" = '38153'
OR "d_site" = '39000' OR "d_site" = '46525' OR "d_site" = '38425' OR "d_site" = '37427' OR "d_site" = '38426'
OR "d_site" = '37429' OR "d_site" = '38427' OR "d_site" = '38386' OR "d_site" = '38428' OR "d_site" = '39877'
OR "d_site" = '38429' OR "d_site" = '40155' OR "d_site" = '38430' OR "d_site" = '40175' OR "d_site" = '38431'
OR "d_site" = '40308' OR "d_site" = '41715' OR "d_site" = '40309' OR "d_site" = '51791' OR "d_site" = '50332'
OR "d_site" = '21227' OR "d_site" = '43130' OR "d_site" = '21228' OR "d_site" = '43131' OR "d_site" = '21229'
OR "d_site" = '55014' OR "d_site" = '21230' OR "d_site" = '55016' OR "d_site" = '28178' OR "d_site" = '55020'
OR "d_site" = '31121' OR "d_site" = '15367' OR "d_site" = '35546' OR "d_site" = '15528' OR "d_site" = '42478'
OR "d_site" = '28043' OR "d_site" = '43720' OR "d_site" = '28044' OR "d_site" = '43721' OR "d_site" = '28045'
OR "d_site" = '49442' OR "d_site" = '53591' OR "d_site" = '24680' OR "d_site" = '56032' OR "d_site" = '34316'
OR "d_site" = '34313' OR "d_site" = '24699' OR "d_site" = '24677' OR "d_site" = '24676' OR "d_site" = '24675'
OR "d_site" = '24297' OR "d_site" = '24679' OR "d_site" = '24678' OR "d_site" = '23797' OR "d_site" = '23796'
OR "d_site" = '18388' OR "d_site" = '15000') AND ("c-geo:c3" = 'usa' OR "c-geo:c3" = 'dom' OR "c-geo:c3" = 'jam'
OR "c-geo:c3" = 'can' OR "c-geo:c3" = 'egy' OR "c-geo:c3" = 'mar' OR "c-geo:c3" = 'dza' OR "c-geo:c3" = 'lby'
OR "c-geo:c3" = 'tgo' OR "c-geo:c3" = 'gha' OR "c-geo:c3" = 'nga' OR "c-geo:c3" = 'cmr' OR "c-geo:c3" = 'ken'
OR "c-geo:c3" = 'uga' OR "c-geo:c3" = 'zmb' OR "c-geo:c3" = 'zaf' OR "c-geo:c3" = 'abw' OR "c-geo:c3" = 'grc'
OR "c-geo:c3" = 'nld' OR "c-geo:c3" = 'bel') AND (TIMESTAMP '2019-02-01 00:00:00' <= __time AND __time <= TIMESTAMP '2019-02-28 00:00:00'))
AND ("cid" = 'mjzrq2v') GROUP BY "c-geo:c3", "d_site"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment