s-button/335620#335620ไม่จำเป็นต้องใช้ตารางทั้งหมด
s-button/335620#335620It is not neccessary to use all the tables.
 CloseReasonTypes:  Id [ number]  Name [ text]  Description [ text] 
SELECT CASE WHEN PostTypeId = 1 THEN '<hr>' ELSE '' END + '<div>' + '<div>' + Title + '</div>' + '</div>' AS html FROM (SELECT q.Title, '//stackoverflow.com/q/' + CAST(p.Id AS TEXT) AS anchor, CASE WHEN p.PostTypeId = 1 THEN q.Title ELSE 'answer' END AS anchortext, p.Body, q.Tags, q.Score, p.PostTypeId, COALESCE(p.ParentId, p.Id) AS grp FROM Posts AS p INNER JOIN Posts AS q ON q.Id = COALESCE(p.ParentId, p.Id) INNER JOIN Votes AS v ON v.PostId = q.Id WHERE v.VoteTypeId = 5 AND v.UserId = '##userid?5175709##') AS favposts ORDER BY grp, PostTypeId, Score DESC