Q&A about the site for members of the workforce navigating the professional setting
SELECT p.Id AS [Post Link], p.Score AS 'Post Score', COALESCE(p.Tags, q.Tags) AS Tags, p.CreationDate, p.OwnerUserId AS [User Link], c.Id AS [Comment Link], c.Score, c.CreationDate, c.UserId AS [User Link] FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id LEFT OUTER JOIN Posts AS q ON q.Id = p.ParentId WHERE c.Text COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%' + ##query:string## + '%' AND p.PostTypeId = ##postTypeId:int?1## -- postTypeId: 1 = questions, 2 = answers ORDER BY c.Score DESC