with parent(id, parentid, body, owneruserid, lasteditorus...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

with parent(id, parentid, body, owneruserid, lasteditoruserid) as (
select p.id, p.parentid, p.body, p.owneruserid, p.lasteditoruserid
from posts p
where p.id = 580639)

select p.id,
sum(CASE
WHEN u.reputation > 500 THEN 1
    END) as rm
from parent p join posts p2 on p2.parentid = p.id
join users u on u.id = p2.owneruserid or u.id = p2.lasteditoruserid
group by p.id;

with parent(id, parentid, body, owneruserid, lasteditoruserid) as (
select p.id, p.parentid, p.body, p.owneruserid, p.lasteditoruserid
from posts p
where p.id = 580639)

select p.id,
sum(CASE WHEN u.reputation > 500 THEN 1 END) as rm
from parent p join users u on u.id = p.owneruserid or u.id = p.lasteditoruserid
group by p.id;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results