home / russian-ads

russian-ads

Custom SQL query returning 62 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
b1201 placements:News Feed on mobile devices 201 ['d3539', 'b1201'] See 201 ads matching ["d3539","b1201"]
cc5ed location_living_in:United States 201 ['d3539', 'cc5ed'] See 201 ads matching ["d3539","cc5ed"]
e6200 placements:News Feed on desktop computers 201 ['d3539', 'e6200'] See 201 ads matching ["d3539","e6200"]
4f89e people_who_match:interests:La Raza 198 ['d3539', '4f89e'] See 198 ads matching ["d3539","4f89e"]
371f0 age:18 - 65+ 196 ['d3539', '371f0'] See 196 ads matching ["d3539","371f0"]
ffca2 people_who_match:interests:Chicano rap 188 ['d3539', 'ffca2'] See 188 ads matching ["d3539","ffca2"]
007df people_who_match:interests:Latin hip hop 186 ['d3539', '007df'] See 186 ads matching ["d3539","007df"]
60626 people_who_match:interests:Hispanidad 186 ['d3539', '60626'] See 186 ads matching ["d3539","60626"]
839f9 people_who_match:interests:Lowrider 185 ['d3539', '839f9'] See 185 ads matching ["d3539","839f9"]
5f10e people_who_match:interests:Mexico 184 ['d3539', '5f10e'] See 184 ads matching ["d3539","5f10e"]
4a957 people_who_match:interests:Mexican Pride 76 ['d3539', '4a957'] See 76 ads matching ["d3539","4a957"]
5849a people_who_match:interests:Mexican american culture 76 ['d3539', '5849a'] See 76 ads matching ["d3539","5849a"]
5dcb2 people_who_match:interests:Chicano 76 ['d3539', '5dcb2'] See 76 ads matching ["d3539","5dcb2"]
eab5e people_who_match:interests:Hispanic culture 73 ['d3539', 'eab5e'] See 73 ads matching ["d3539","eab5e"]
d9d8c people_who_match:interests:Hispanic and latino american culture 70 ['d3539', 'd9d8c'] See 70 ads matching ["d3539","d9d8c"]
8b401 people_who_match:interests:Latino culture 69 ['d3539', '8b401'] See 69 ads matching ["d3539","8b401"]
81cf6 people_who_match:interests:Being Chicano 29 ['d3539', '81cf6'] See 29 ads matching ["d3539","81cf6"]
154c2 people_who_match:interests:Culture of Mexico 11 ['d3539', '154c2'] See 11 ads matching ["d3539","154c2"]
68743 people_who_match:interests:Chicano rep 8 ['d3539', '68743'] See 8 ads matching ["d3539","68743"]
399e5 people_who_match:interests:Hispanic american culture 4 ['d3539', '399e5'] See 4 ads matching ["d3539","399e5"]
59d75 language:English (US) 4 ['d3539', '59d75'] See 4 ads matching ["d3539","59d75"]
bb97d people_who_match:interests:Being Mexican 4 ['d3539', 'bb97d'] See 4 ads matching ["d3539","bb97d"]
07bd5 people_who_match:interests:Being Latino 3 ['d3539', '07bd5'] See 3 ads matching ["d3539","07bd5"]
2ed33 excluded_connections:Exclude people who like Brown Power 3 ['d3539', '2ed33'] See 3 ads matching ["d3539","2ed33"]
5e075 language:English (UK) 3 ['d3539', '5e075'] See 3 ads matching ["d3539","5e075"]
694c8 people_who_match:interests:Mexican American Pride 3 ['d3539', '694c8'] See 3 ads matching ["d3539","694c8"]
7b150 age:18 — 65+ 3 ['d3539', '7b150'] See 3 ads matching ["d3539","7b150"]
902e5 placements:Right column on desktop computers 3 ['d3539', '902e5'] See 3 ads matching ["d3539","902e5"]
a56e6 and_must_also_match:interests:La Raza 3 ['d3539', 'a56e6'] See 3 ads matching ["d3539","a56e6"]
cd6c0 people_who_match:interests:80 Mexican 3 ['d3539', 'cd6c0'] See 3 ads matching ["d3539","cd6c0"]
d2747 language:Spanish 3 ['d3539', 'd2747'] See 3 ads matching ["d3539","d2747"]
f9d07 language:Spanish (Spain) 3 ['d3539', 'f9d07'] See 3 ads matching ["d3539","f9d07"]
4801f age:16 - 65+ 2 ['d3539', '4801f'] See 2 ads matching ["d3539","4801f"]
cea04 people_who_match:interests:Mexico Being Chicano 2 ['d3539', 'cea04'] See 2 ads matching ["d3539","cea04"]
e395d people_who_match:interests:Hispanic and latino americah culture 2 ['d3539', 'e395d'] See 2 ads matching ["d3539","e395d"]
0f025 people_who_match:interests:Texas Hog Hunting 1 ['d3539', '0f025'] See 1 ads matching ["d3539","0f025"]
13c31 people_who_match:interests:Keep Texas Working 1 ['d3539', '13c31'] See 1 ads matching ["d3539","13c31"]
1de99 people_who_match:interests:Don't Mess with Texas 1 ['d3539', '1de99'] See 1 ads matching ["d3539","1de99"]
24608 people_who_match:interests:Don't Mess with Texas Program 1 ['d3539', '24608'] See 1 ads matching ["d3539","24608"]
3502d placements:Instagram Feed 1 ['d3539', '3502d'] See 1 ads matching ["d3539","3502d"]
3edb9 people_who_match:interests:Texas Parks and Wildlife — Hunt 1 ['d3539', '3edb9'] See 1 ads matching ["d3539","3edb9"]
441d6 people_who_match:interests:Texas Secession 1 ['d3539', '441d6'] See 1 ads matching ["d3539","441d6"]
4a664 people_who_match:interests:The Texas Huntress 1 ['d3539', '4a664'] See 1 ads matching ["d3539","4a664"]
52578 people_who_match:interests:Texas Got It Right 1 ['d3539', '52578'] See 1 ads matching ["d3539","52578"]
6492e people_who_match:interests:Texas Values 1 ['d3539', '6492e'] See 1 ads matching ["d3539","6492e"]
7950f people_who_match:interests:Houston 1 ['d3539', '7950f'] See 1 ads matching ["d3539","7950f"]
8166c people_who_match:interests:Texas Gun Owner 1 ['d3539', '8166c'] See 1 ads matching ["d3539","8166c"]
82178 people_who_match:interests:Open Carry Texas 1 ['d3539', '82178'] See 1 ads matching ["d3539","82178"]
82e15 people_who_match:interests:Texas 1 ['d3539', '82e15'] See 1 ads matching ["d3539","82e15"]
8bc92 people_who_match:interests:Texas Deer Association 1 ['d3539', '8bc92'] See 1 ads matching ["d3539","8bc92"]
98a04 people_who_match:interests:Texas Deer Hunting 1 ['d3539', '98a04'] See 1 ads matching ["d3539","98a04"]
9d28e people_who_match:interests:Hispanic: and latino american culture 1 ['d3539', '9d28e'] See 1 ads matching ["d3539","9d28e"]
a053e people_who_match:interests:Republic of Texas 1 ['d3539', 'a053e'] See 1 ads matching ["d3539","a053e"]
a0a68 people_who_match:interests:Texas Nationalist Movement 1 ['d3539', 'a0a68'] See 1 ads matching ["d3539","a0a68"]
a53c4 people_who_match:interests:Texas Gun Talk 1 ['d3539', 'a53c4'] See 1 ads matching ["d3539","a53c4"]
ca677 people_who_match:interests:Hog Hunting Texas Style 1 ['d3539', 'ca677'] See 1 ads matching ["d3539","ca677"]
d68f2 people_who_match:interests:Daughters of the Republic of Texas 1 ['d3539', 'd68f2'] See 1 ads matching ["d3539","d68f2"]
ec0bb people_who_match:interests:Texas Born Texas Proud 1 ['d3539', 'ec0bb'] See 1 ads matching ["d3539","ec0bb"]
ec3ac location:United States 1 ['d3539', 'ec3ac'] See 1 ads matching ["d3539","ec3ac"]
f4a45 people_who_match:interests:Lowrideri Chicano rap 1 ['d3539', 'f4a45'] See 1 ads matching ["d3539","f4a45"]
f5427 age:14 - 65+ 1 ['d3539', 'f5427'] See 1 ads matching ["d3539","f5427"]
ff445 people_who_match:interests:Texas secession movements 1 ['d3539', 'ff445'] See 1 ads matching ["d3539","ff445"]
Powered by Datasette · Query took 101.528ms