use hahn;

$emails_part1 = (
    select distinct Email
    from `//home/webmaster/users/lester/WMC-9847/hosts-iter1`
);

select 
    Email,
    Domain,
    "https://webmaster.yandex.ru/site/" || HostId || "/turbo/settings/advertising/" as LinkTurboAdv
from `//home/webmaster/prod/analytics/mailings/base`
where ListLength(Yson::ConvertToList(TurboAdvertising)) == 0
    and IsTurboContent
    and not IsEuropeanUser
    and LanguageRU
    and Email not in $emails_part1
group by
    Email,
    Domain,
    HostId
order by
    Email,
    Domain,
    LinkTurboAdv
