SELECT p.Id AS id, REPLACE(p.Title, ',', ' ') AS title, ...


Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans

Q&A for music historians, critics, and fans

SELECT  p.Id AS id,
      REPLACE(p.Title, ',', ' ') AS title,
      p.Tags AS tags,
      CONVERT(VARCHAR(20), p.CreationDate, 120) AS creation_date, 
      CONVERT(VARCHAR(20), p.LastActivityDate, 120) AS last_activity_date,
      ISNULL(p.FavoriteCount, 0) AS favourite_count, 
      ISNULL(p.ViewCount, 0) AS view_count,
      ISNULL(v.UpVote, 0) AS up_votes, 
      ISNULL(v.DownVote, 0) AS down_votes,
      Replace(p.Body, '\r\n', 'abcdefg') AS body
(SELECT Votes.PostID, 
        UpVote = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), 
        DownVote = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) 
        FROM Votes WHERE VoteTypeId in (2,3) GROUP BY PostId) v
RIGHT JOIN Posts p ON v.PostID =
WHERE p.Id = 18303180

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results