आप नीचे कोशिश कर सकते हैं- case when
. का उपयोग करके अभिव्यक्ति
select "uid", "username", count(case when state = 'finished' then id end) as games_hosted
from "users" inner join "games"
on "games"."user_uid" = "users"."uid"
where "games"."state" in ('published', 'finished') and "username" < 'HariShankar'
group by "uid", "username"
order by "username" desc
limit 10