Q&A for ebook publishers and readers
-- Input: UserId (taken from the URL when you are on your profile) -- Output: Score, link to comment, link to post, Text, CreationDate, link to user DECLARE @UserId int = ##UserId## SELECT c.Score, c.Id as [Comment Link], p.Id as [Post Link], c.Text, c.CreationDate, c.UserId as [User Link] FROM Comments c, Posts p WHERE p.Id = c.PostId AND c.UserId = @UserId ORDER BY c.Score DESC