Q&A for users and developers of hardware and software for Raspberry Pi
SELECT TOP(##num##) p.Id AS [Post Link], p.AcceptedAnswerId, bs.CreationDate, ac.CreationDate, p.CreationDate, url = 'site://posts/' + CAST(p.Id AS varchar)+'/revisions', url = 'site://posts/' + CAST(p.Id AS varchar)+'/timeline' FROM Posts p INNER JOIN Votes bs ON (p.Id = bs.PostId AND bs.VoteTypeId = 8) LEFT JOIN Votes ac ON (p.AcceptedAnswerId = ac.PostId and ac.VoteTypeId = 1) WHERE (p.PostTypeId=1) AND (p.AcceptedAnswerId IS NOT NULL) AND (ac.CreationDate < bs.CreationDate) ORDER BY p.CreationDate DESC