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,tags,creationdate) as (
select p.id, p.parentid, p.body, p.owneruserid, p.lasteditoruserid, p.tags,p.creationdate
from posts p join posttags t on t.postid = p.id
where p.creationdate >= '2018.1.1' and p.creationdate < '2019.1.1' and t.tagid = 16)
, answer(id,sum2) as
(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)
, question(id,sum1) as (
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)

select * from question;

Enter Parameters

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