что это за позорище? Есть же комбинация клавиш, ctrl f или у кого как настроеноА смысл опираться на вариативную комбинацию, если есть более однозначный вариант, который передает суть?
select
user_id,
max(qqq)
from(
select
4 as qqq,
user_id
from users_auth
inner join (select user_agent,gpu,screen,langs from users_auth group by user_agent,gpu,screen,langs having count(*)>1) as by_all
on users_auth.user_agent=by_all.user_agent and users_auth.gpu=by_all.gpu
and users_auth.screen=by_all.screen and users_auth.langs=by_all.langs
union
select
3 as qqq,
user_id
from users_auth inner join (select user_agent,gpu,screen from users_auth group by user_agent,gpu,screen having count(*)>1) as by_three
on users_auth.user_agent=by_three.user_agent and users_auth.gpu=by_three.gpu
and users_auth.screen=by_three.screen
union
select
2 as qqq,
user_id
from users_auth inner join (select user_agent,gpu from users_auth group by user_agent,gpu having count(*)>1) as by_two
on users_auth.user_agent=by_two.user_agent and users_auth.gpu=by_two.gpu
) as users
group by user_id
;