comment partition by question

0

Please login or register to vote for this query.

(click on this box to dismiss)

Cognitive Sciences Meta

Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry

WITH CS AS (
		  SELECT      PostId
			FROM        Comments
			WHERE       UserId = 39930
			GROUP BY        PostId
		)
		SELECT CS.PostId, 
            CASE    WHEN Posts.PostTypeId = 1
                    THEN Posts.Id
                    ELSE Posts.ParentId
            END
            AS [Post Link]
            
		FROM        CS 
			INNER JOIN Posts
			ON Posts.Id = CS.PostId

Enter Parameters

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