home / russian-ads

russian-ads

Custom SQL query returning 87 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) 190 ['ebf60', '59d75'] See 190 ads matching ["ebf60","59d75"]
b1201 placements:News Feed on mobile devices 190 ['ebf60', 'b1201'] See 190 ads matching ["ebf60","b1201"]
e6200 placements:News Feed on desktop computers 188 ['ebf60', 'e6200'] See 188 ads matching ["ebf60","e6200"]
5e075 language:English (UK) 184 ['ebf60', '5e075'] See 184 ads matching ["ebf60","5e075"]
e128e people_who_match:interests:Black (Color) 180 ['ebf60', 'e128e'] See 180 ads matching ["ebf60","e128e"]
abb72 people_who_match:interests:African-American history 173 ['ebf60', 'abb72'] See 173 ads matching ["ebf60","abb72"]
ec3ac location:United States 160 ['ebf60', 'ec3ac'] See 160 ads matching ["ebf60","ec3ac"]
4801f age:16 - 65+ 152 ['ebf60', '4801f'] See 152 ads matching ["ebf60","4801f"]
a1307 people_who_match:interests:African-American Civil Rights Movement (1954—68) 127 ['ebf60', 'a1307'] See 127 ads matching ["ebf60","a1307"]
41b26 people_who_match:interests:Black Consciousness Movement 92 ['ebf60', '41b26'] See 92 ads matching ["ebf60","41b26"]
6a38c people_who_match:interests:Stop Police Brutality 92 ['ebf60', '6a38c'] See 92 ads matching ["ebf60","6a38c"]
9a8c6 people_who_match:interests:Police misconduct 92 ['ebf60', '9a8c6'] See 92 ads matching ["ebf60","9a8c6"]
d6347 people_who_match:interests:Black nationalism 92 ['ebf60', 'd6347'] See 92 ads matching ["ebf60","d6347"]
2db78 people_who_match:interests:Martin Luther King III 90 ['ebf60', '2db78'] See 90 ads matching ["ebf60","2db78"]
a2d21 people_who_match:interests:African-American culture 60 ['ebf60', 'a2d21'] See 60 ads matching ["ebf60","a2d21"]
1d2ab people_who_match:interests:African—American Civil Rights Movement (1954—68) 49 ['ebf60', '1d2ab'] See 49 ads matching ["ebf60","1d2ab"]
91693 people_who_match:interests:African—American culture 48 ['ebf60', '91693'] See 48 ads matching ["ebf60","91693"]
371f0 age:18 - 65+ 29 ['ebf60', '371f0'] See 29 ads matching ["ebf60","371f0"]
27369 people_who_match:interests:Malcolm X 28 ['ebf60', '27369'] See 28 ads matching ["ebf60","27369"]
862ed people_who_match:interests:Jr. 28 ['ebf60', '862ed'] See 28 ads matching ["ebf60","862ed"]
8a7ee people_who_match:interests:Martin Luther King 28 ['ebf60', '8a7ee'] See 28 ads matching ["ebf60","8a7ee"]
18a64 people_who_match:interests:Black Power 27 ['ebf60', '18a64'] See 27 ads matching ["ebf60","18a64"]
7c38f people_who_match:interests:Black Panther Party 27 ['ebf60', '7c38f'] See 27 ads matching ["ebf60","7c38f"]
f788a people_who_match:interests:Black history 27 ['ebf60', 'f788a'] See 27 ads matching ["ebf60","f788a"]
809af people_who_match:interests:Black History Month 25 ['ebf60', '809af'] See 25 ads matching ["ebf60","809af"]
01e8a and_must_also_match:interests:Right of self—defense 24 ['ebf60', '01e8a'] See 24 ads matching ["ebf60","01e8a"]
2aa57 and_must_also_match:interests:Self Defense Family 24 ['ebf60', '2aa57'] See 24 ads matching ["ebf60","2aa57"]
425d7 and_must_also_match:interests:Active Self Protection 24 ['ebf60', '425d7'] See 24 ads matching ["ebf60","425d7"]
66f82 people_who_match:interests:African American 24 ['ebf60', '66f82'] See 24 ads matching ["ebf60","66f82"]
724f8 and_must_also_match:interests:The Women's Self Defense Institute 24 ['ebf60', '724f8'] See 24 ads matching ["ebf60","724f8"]
7c580 and_must_also_match:interests:Martial arts 24 ['ebf60', '7c580'] See 24 ads matching ["ebf60","7c580"]
8b0bf and_must_also_match:interests:Personal Defense 24 ['ebf60', '8b0bf'] See 24 ads matching ["ebf60","8b0bf"]
93975 people_who_match:interests:Angela Davis 24 ['ebf60', '93975'] See 24 ads matching ["ebf60","93975"]
9c206 and_must_also_match:interests:Mixed martial arts 24 ['ebf60', '9c206'] See 24 ads matching ["ebf60","9c206"]
b6f60 and_must_also_match:interests:PERSONAL & HOME DEFENSE 24 ['ebf60', 'b6f60'] See 24 ads matching ["ebf60","b6f60"]
06d39 and_must_also_match:interests:SeIf-defense 18 ['ebf60', '06d39'] See 18 ads matching ["ebf60","06d39"]
2ab82 and_must_also_match:interests:Self- defense (United States) 18 ['ebf60', '2ab82'] See 18 ads matching ["ebf60","2ab82"]
37724 people_who_match:interests:Self Defense Family 17 ['ebf60', '37724'] See 17 ads matching ["ebf60","37724"]
80def people_who_match:interests:The Self Defense Company 17 ['ebf60', '80def'] See 17 ads matching ["ebf60","80def"]
d5ec6 people_who_match:interests:Martial arts 17 ['ebf60', 'd5ec6'] See 17 ads matching ["ebf60","d5ec6"]
ebcbb location_living_in:united_states:New York (+25 mi) New York 14 ['ebf60', 'ebcbb'] See 14 ads matching ["ebf60","ebcbb"]
902e5 placements:Right column on desktop computers 11 ['ebf60', '902e5'] See 11 ads matching ["ebf60","902e5"]
e4503 excluded_connections:Exclude people who like Nefertiti's Community 10 ['ebf60', 'e4503'] See 10 ads matching ["ebf60","e4503"]
bbdfd people_who_match:interests:Kemetism 7 ['ebf60', 'bbdfd'] See 7 ads matching ["ebf60","bbdfd"]
39ce1 and_must_also_match:interests:Self— defense (United States) 6 ['ebf60', '39ce1'] See 6 ads matching ["ebf60","39ce1"]
4225c people_who_match:interests:African—American history 6 ['ebf60', '4225c'] See 6 ads matching ["ebf60","4225c"]
6d811 and_must_also_match:interests:SeIf—defense 6 ['ebf60', '6d811'] See 6 ads matching ["ebf60","6d811"]
7b150 age:18 — 65+ 6 ['ebf60', '7b150'] See 6 ads matching ["ebf60","7b150"]
7746b people_who_match:interests:Black Girls Rock! 5 ['ebf60', '7746b'] See 5 ads matching ["ebf60","7746b"]
cc5ed location_living_in:United States 5 ['ebf60', 'cc5ed'] See 5 ads matching ["ebf60","cc5ed"]
d2749 people_who_match:interests:African— American culture 5 ['ebf60', 'd2749'] See 5 ads matching ["ebf60","d2749"]
4f515 location_living_in:united_states:Long Beach (+25 mi) California 4 ['ebf60', '4f515'] See 4 ads matching ["ebf60","4f515"]
70feb age:18 - 60 4 ['ebf60', '70feb'] See 4 ads matching ["ebf60","70feb"]
14760 people_who_match:interests:Black Enterprise 3 ['ebf60', '14760'] See 3 ads matching ["ebf60","14760"]
9c17e location_living_in:united_states:Lansing (+25 mi) Michigan 3 ['ebf60', '9c17e'] See 3 ads matching ["ebf60","9c17e"]
a5ab5 people_who_match:interests:African-Amerioan culture 3 ['ebf60', 'a5ab5'] See 3 ads matching ["ebf60","a5ab5"]
3da9b excluded_connections:Exclude people who like Pan-African roots MOVE 2 ['ebf60', '3da9b'] See 2 ads matching ["ebf60","3da9b"]
42bf9 people_who_match:interests:Refugees of the Syrian Civil War 2 ['ebf60', '42bf9'] See 2 ads matching ["ebf60","42bf9"]
4accc placements:on pages: News Feed on desktop computers 2 ['ebf60', '4accc'] See 2 ads matching ["ebf60","4accc"]
60170 placements:Suggested Video on desktop computers 2 ['ebf60', '60170'] See 2 ads matching ["ebf60","60170"]
7a9b5 placements:Suggested Video on mobile devices 2 ['ebf60', '7a9b5'] See 2 ads matching ["ebf60","7a9b5"]
c4c8c people_who_match:interests:Syria-News 2 ['ebf60', 'c4c8c'] See 2 ads matching ["ebf60","c4c8c"]
d1aa5 people_who_match:interests:My Black is Beautiful 2 ['ebf60', 'd1aa5'] See 2 ads matching ["ebf60","d1aa5"]
df1f0 people_who_match:interests:African- American culture 2 ['ebf60', 'df1f0'] See 2 ads matching ["ebf60","df1f0"]
f6c6f people_who_match:interests:Syria Charity 2 ['ebf60', 'f6c6f'] See 2 ads matching ["ebf60","f6c6f"]
086cd people_who_match:interests:Martin Luther King I” 1 ['ebf60', '086cd'] See 1 ads matching ["ebf60","086cd"]
1518e people_who_match:interests:Behaviors: African American (US) 1 ['ebf60', '1518e'] See 1 ads matching ["ebf60","1518e"]
2ce65 people_who_match:interests:Black is beautiful 1 ['ebf60', '2ce65'] See 1 ads matching ["ebf60","2ce65"]
2d05d location_living_in:united_states:Alabama; Florida; Georgia; Illinois; Louisiana; Mississippi; New York; South Carolina; Virginia 1 ['ebf60', '2d05d'] See 1 ads matching ["ebf60","2d05d"]
302cc people_who_match:interests:Black Girls Rock! or HuffPost Black Voices 1 ['ebf60', '302cc'] See 1 ads matching ["ebf60","302cc"]
3502d placements:Instagram Feed 1 ['ebf60', '3502d'] See 1 ads matching ["ebf60","3502d"]
35dce people_who_match:interests:Behaviors: Small business owners 1 ['ebf60', '35dce'] See 1 ads matching ["ebf60","35dce"]
3bf00 location_living_in:China 1 ['ebf60', '3bf00'] See 1 ads matching ["ebf60","3bf00"]
3c576 people_who_match:interests:Martin Luther King lll 1 ['ebf60', '3c576'] See 1 ads matching ["ebf60","3c576"]
3fbed people_who_match:interests:African-Amerioan history 1 ['ebf60', '3fbed'] See 1 ads matching ["ebf60","3fbed"]
487f2 people_who_match:interests:African-Amerioan Civil Rights Movement (1954—68) 1 ['ebf60', '487f2'] See 1 ads matching ["ebf60","487f2"]
49309 people_who_match:interests:Women's fashion 1 ['ebf60', '49309'] See 1 ads matching ["ebf60","49309"]
4e97e location_living_in:united_states:Atlanta (+25 mi) Georgia 1 ['ebf60', '4e97e'] See 1 ads matching ["ebf60","4e97e"]
5a04b people_who_match:interests:The Move 1 ['ebf60', '5a04b'] See 1 ads matching ["ebf60","5a04b"]
5ef55 people_who_match:interests:Black Enterprise or Black (Color) 1 ['ebf60', '5ef55'] See 1 ads matching ["ebf60","5ef55"]
6b1c5 location_living_in:united_states:Astoria (+50 mi) New York 1 ['ebf60', '6b1c5'] See 1 ads matching ["ebf60","6b1c5"]
6f328 people_who_match:interests:Afrocentrism 1 ['ebf60', '6f328'] See 1 ads matching ["ebf60","6f328"]
9848a people_who_match:interests:African- American Civil Rights Movement (1954—68) 1 ['ebf60', '9848a'] See 1 ads matching ["ebf60","9848a"]
c4d21 location_living_in:united_states:Orlando (+50 mi) Florida 1 ['ebf60', 'c4d21'] See 1 ads matching ["ebf60","c4d21"]
cd49b excluded_connections:Exclude people who like Pan—African roots MOVE 1 ['ebf60', 'cd49b'] See 1 ads matching ["ebf60","cd49b"]
d65e1 people_who_match:interests:Fight the Power 1 ['ebf60', 'd65e1'] See 1 ads matching ["ebf60","d65e1"]
da17a people_who_match:interests:Melanin 1 ['ebf60', 'da17a'] See 1 ads matching ["ebf60","da17a"]
Powered by Datasette · Query took 149.202ms