АК
Size: a a a
АК
РЖ
DM
АК
DM
АК
АК
КТ
DM
DM
АК
select collectible_id, token as user_token, user_id, count as taked_count
from collectibles_collectible
left join (
select *
from accounts_tokenbesideuser
join collectibles_takencollectible
on accounts_tokenbesideuser.id = collectibles_takencollectible.user_id
where user_id = users.user_id
) as foo on foo.collectible_id = collectibles_collectible.id
АК
АК
YS
КТ
YS
YS
АК
АК
АК
select * from
(select(
select case
when 0 < (select count(*)
from (
select user_id
from collectibles_collectible
left join (
select *
from accounts_tokenbesideuser
join collectibles_takencollectible
on accounts_tokenbesideuser.id = collectibles_takencollectible.user_id
where user_id = users.user_id
) as foo on foo.collectible_id = collectibles_collectible.id
where user_id is null
) as ccfui) then false
else true end
) as is_win,
user_id
from (
select distinct (user_id) as user_id
from collectibles_takencollectible
) as users
)
as main where is_win = true;