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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness

Q&A for physical fitness professionals, athletes, trainers, and those providing health-related needs

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 p2.*
from parent p join posts p2 on p2.parentid = p.id
join users u on u.id = p.owneruserid or u.id = p.lasteditoruserid;



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 = 250550)

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 sites:
loading Hold tight while we fetch your results