home / russian-ads

russian-ads

Custom SQL query returning 58 rows

select
    target_id,
    targets.name,
    count(*) as n,
    json_object(
        "href", "/russian-ads/faceted-targets?targets=" || urllib_quote_plus(
            json_insert(:targets, '$[' || json_array_length(:targets) || ']', target_id)
        ),
        "label", json_insert(:targets, '$[' || json_array_length(:targets) || ']', target_id)
    ) as apply_this_facet,
    json_object(
        "href", "/russian-ads/display_ads?_targets_json=" || urllib_quote_plus(
            json_insert(:targets, '$[' || json_array_length(:targets) || ']', target_id)
        ),
        "label", "See " || count(*) || " ads matching " || json_insert(:targets, '$[' || json_array_length(:targets) || ']', target_id)
    ) as browse_these_ads
from ad_targets
join targets on ad_targets.target_id = targets.id
where
    json_array_length(:targets) == 0 or
    ad_id in (
        select ad_id
        from "ad_targets"
        where "ad_targets".target_id in (select value from json_each(:targets))
        group by "ad_targets".ad_id
        having count(distinct "ad_targets".target_id) = json_array_length(:targets)
    )
    and target_id not in (select value from json_each(:targets))
group by
    target_id order by n desc

Query parameters

target_idnamenapply_this_facetbrowse_these_ads
59d75 language:English (US) 108 ['d6347', '59d75'] See 108 ads matching ["d6347","59d75"]
ec3ac location:United States 108 ['d6347', 'ec3ac'] See 108 ads matching ["d6347","ec3ac"]
41b26 people_who_match:interests:Black Consciousness Movement 107 ['d6347', '41b26'] See 107 ads matching ["d6347","41b26"]
b1201 placements:News Feed on mobile devices 106 ['d6347', 'b1201'] See 106 ads matching ["d6347","b1201"]
5e075 language:English (UK) 105 ['d6347', '5e075'] See 105 ads matching ["d6347","5e075"]
6a38c people_who_match:interests:Stop Police Brutality 105 ['d6347', '6a38c'] See 105 ads matching ["d6347","6a38c"]
9a8c6 people_who_match:interests:Police misconduct 105 ['d6347', '9a8c6'] See 105 ads matching ["d6347","9a8c6"]
e128e people_who_match:interests:Black (Color) 105 ['d6347', 'e128e'] See 105 ads matching ["d6347","e128e"]
e6200 placements:News Feed on desktop computers 105 ['d6347', 'e6200'] See 105 ads matching ["d6347","e6200"]
2db78 people_who_match:interests:Martin Luther King III 103 ['d6347', '2db78'] See 103 ads matching ["d6347","2db78"]
abb72 people_who_match:interests:African-American history 99 ['d6347', 'abb72'] See 99 ads matching ["d6347","abb72"]
4801f age:16 - 65+ 94 ['d6347', '4801f'] See 94 ads matching ["d6347","4801f"]
ebf60 people_who_match:interests:Pan-Africanism 92 ['d6347', 'ebf60'] See 92 ads matching ["d6347","ebf60"]
a1307 people_who_match:interests:African-American Civil Rights Movement (1954—68) 58 ['d6347', 'a1307'] See 58 ads matching ["d6347","a1307"]
a2d21 people_who_match:interests:African-American culture 57 ['d6347', 'a2d21'] See 57 ads matching ["d6347","a2d21"]
1d2ab people_who_match:interests:African—American Civil Rights Movement (1954—68) 47 ['d6347', '1d2ab'] See 47 ads matching ["d6347","1d2ab"]
91693 people_who_match:interests:African—American culture 47 ['d6347', '91693'] See 47 ads matching ["d6347","91693"]
13ab6 people_who_match:interests:Pan—Africanism 12 ['d6347', '13ab6'] See 12 ads matching ["d6347","13ab6"]
c3b9b age:16 — 65+ 11 ['d6347', 'c3b9b'] See 11 ads matching ["d6347","c3b9b"]
4225c people_who_match:interests:African—American history 6 ['d6347', '4225c'] See 6 ads matching ["d6347","4225c"]
18a64 people_who_match:interests:Black Power 3 ['d6347', '18a64'] See 3 ads matching ["d6347","18a64"]
27369 people_who_match:interests:Malcolm X 3 ['d6347', '27369'] See 3 ads matching ["d6347","27369"]
3502d placements:Instagram Feed 2 ['d6347', '3502d'] See 2 ads matching ["d6347","3502d"]
3fbed people_who_match:interests:African-Amerioan history 2 ['d6347', '3fbed'] See 2 ads matching ["d6347","3fbed"]
487f2 people_who_match:interests:African-Amerioan Civil Rights Movement (1954—68) 2 ['d6347', '487f2'] See 2 ads matching ["d6347","487f2"]
6a05f people_who_match:interests:New Black Panther Party 2 ['d6347', '6a05f'] See 2 ads matching ["d6347","6a05f"]
7c38f people_who_match:interests:Black Panther Party 2 ['d6347', '7c38f'] See 2 ads matching ["d6347","7c38f"]
a5ab5 people_who_match:interests:African-Amerioan culture 2 ['d6347', 'a5ab5'] See 2 ads matching ["d6347","a5ab5"]
b322d people_who_match:interests:Pan-Afrioanism 2 ['d6347', 'b322d'] See 2 ads matching ["d6347","b322d"]
014b0 age:13 — 65+ 1 ['d6347', '014b0'] See 1 ads matching ["d6347","014b0"]
086cd people_who_match:interests:Martin Luther King I” 1 ['d6347', '086cd'] See 1 ads matching ["d6347","086cd"]
15228 and_must_also_match:interests:Pan-African colours 1 ['d6347', '15228'] See 1 ads matching ["d6347","15228"]
1e076 and_must_also_match:interests:Kemetism 1 ['d6347', '1e076'] See 1 ads matching ["d6347","1e076"]
23e78 and_must_also_match:interests:Kwame Nkrumah 1 ['d6347', '23e78'] See 1 ads matching ["d6347","23e78"]
23f8e and_must_also_match:interests:Afrocentrism 1 ['d6347', '23f8e'] See 1 ads matching ["d6347","23f8e"]
2ce65 people_who_match:interests:Black is beautiful 1 ['d6347', '2ce65'] See 1 ads matching ["d6347","2ce65"]
371f0 age:18 - 65+ 1 ['d6347', '371f0'] See 1 ads matching ["d6347","371f0"]
3c576 people_who_match:interests:Martin Luther King lll 1 ['d6347', '3c576'] See 1 ads matching ["d6347","3c576"]
3da9b excluded_connections:Exclude people who like Pan-African roots MOVE 1 ['d6347', '3da9b'] See 1 ads matching ["d6347","3da9b"]
3f884 and_must_also_match:interests:South Africa 1 ['d6347', '3f884'] See 1 ads matching ["d6347","3f884"]
42bf9 people_who_match:interests:Refugees of the Syrian Civil War 1 ['d6347', '42bf9'] See 1 ads matching ["d6347","42bf9"]
49bb7 and_must_also_match:interests:Hotep 1 ['d6347', '49bb7'] See 1 ads matching ["d6347","49bb7"]
4accc placements:on pages: News Feed on desktop computers 1 ['d6347', '4accc'] See 1 ads matching ["d6347","4accc"]
54d8d and_must_also_match:interests:Nelson Mandela 1 ['d6347', '54d8d'] See 1 ads matching ["d6347","54d8d"]
60170 placements:Suggested Video on desktop computers 1 ['d6347', '60170'] See 1 ads matching ["d6347","60170"]
64dc9 and_must_also_match:interests:Marcus Garvey 1 ['d6347', '64dc9'] See 1 ads matching ["d6347","64dc9"]
6f328 people_who_match:interests:Afrocentrism 1 ['d6347', '6f328'] See 1 ads matching ["d6347","6f328"]
7a9b5 placements:Suggested Video on mobile devices 1 ['d6347', '7a9b5'] See 1 ads matching ["d6347","7a9b5"]
7b150 age:18 — 65+ 1 ['d6347', '7b150'] See 1 ads matching ["d6347","7b150"]
809af people_who_match:interests:Black History Month 1 ['d6347', '809af'] See 1 ads matching ["d6347","809af"]
862ed people_who_match:interests:Jr. 1 ['d6347', '862ed'] See 1 ads matching ["d6347","862ed"]
8a7ee people_who_match:interests:Martin Luther King 1 ['d6347', '8a7ee'] See 1 ads matching ["d6347","8a7ee"]
902e5 placements:Right column on desktop computers 1 ['d6347', '902e5'] See 1 ads matching ["d6347","902e5"]
b5c9f and_must_also_match:interests:Nigeria 1 ['d6347', 'b5c9f'] See 1 ads matching ["d6347","b5c9f"]
c4c8c people_who_match:interests:Syria-News 1 ['d6347', 'c4c8c'] See 1 ads matching ["d6347","c4c8c"]
df1f0 people_who_match:interests:African- American culture 1 ['d6347', 'df1f0'] See 1 ads matching ["d6347","df1f0"]
f6c6f people_who_match:interests:Syria Charity 1 ['d6347', 'f6c6f'] See 1 ads matching ["d6347","f6c6f"]
f788a people_who_match:interests:Black history 1 ['d6347', 'f788a'] See 1 ads matching ["d6347","f788a"]
Powered by Datasette · Query took 79.877ms