/* SELECT v.postid, p.parentid as parent_id, COUNT(*) as ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

/*
SELECT v.postid,
p.parentid as parent_id,
COUNT(*) as vote_activity_frequency
FROM Votes as v
  INNER JOIN Posts as p ON p.id = v.postid
WHERE v.postid IN (
    172739,
    184112,
    211169,
    252180)
    AND v.votetypeid in (1,2, 3, 5, 8, 9)
    GROUP BY v.postid, p.parentid
    */


SELECT v.postid,
p.parentid as parent_id,
COUNT(*) as vote_activity_frequency
FROM Votes as v
  INNER JOIN Posts as p ON p.id = v.postid
WHERE v.postid IN (
Select id from posts where parentid in(
    172739,
    184112,
    211169,
    252180))
    AND v.votetypeid in (1,2, 3, 5, 8, 9)
    GROUP BY v.postid, p.parentid

Enter Parameters

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