Q&A for scientists using computers to solve scientific problems
from Users u
join Badges b on u.Id=b.UserID and u.Location like '%Latvia%'
where exists (
select distinct u.Id
from users u
join Posts p on u.Id=p.OwnerUserId
and p.CreationDate >= '2021-01-01 00:00:00'
and p.CreationDate < '2022-01-01 00:00:00'
group by u.ID, u.DisplayName,u.Location
having count(b.ID) > 100
order by count(b.ID) desc