/*select top 100 case when reputation > 10 then '>10' whe...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Portuguese Language

Q&A for linguists, teachers and learners wanting to discuss the finer points of the Portuguese language

/*select top 100
case when reputation > 10 then '>10' when reputation < 5 then '<5' else '<=10' end as rep,
* from users*/

--for 3rd

/*select count(case when reputation < 100 then 1 end) as less_100,
count(case when reputation >= 100 then 1 end) as more_100
from users*/

--для поиска чела с макс реп
--(деск и лимит 1 нельзя если их несколько можно проебаться)

--solution 1 подзапрос
/*select * from users where reputation = (select max(reputation) from users)*/

/*select top 100 * from users where reputation in (11,13)*/

--люди у которых значение репутации среди всех встречается реже 1000

/*select top 100 * from users
where reputation in
(select reputation from users group by reputation having count(*)<1000)*/

--what reputation value appears more than 10000 times

/*select reputation from users group by reputation having count(*)>100000*/

--for every post we also show user's location

/*select top 100 *, (select location from users where owneruserid=users.id)
from posts*/

--all reputations and how many people have this reputation

/*select reputation, count(*) from users group by reputation*/

--со значени сколько-то юзеров находится столько-то значений репутации

/*select cn, count(*)
from
(select reputation, count(*) as cn from users group by reputation) as x
group by cn
order by cn*/

--common table or some shit

with x as
(select reputation, count(*) as cn from users group by reputation)
select cn, count(*) from x
group by cn
order by cn

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results