Q&A for contractors and serious DIYers
SELECT TOP 20 p.Title as QuestionTitle, p.Body as QuestionBody, t.TagName as Topic, p.ViewCount as TotalViews, p.Score as Score, u.Location as UserLocation, p.CreationDate as PostDate FROM Posts p LEFT JOIN PostTags pt ON p.Id = pt.PostId LEFT JOIN Tags t ON pt.TagId = t.Id LEFT JOIN Users u ON p.OwnerUserId = u.Id WHERE t.TagName IN ('trains', 'public-transport') -- 特定のトピックに限定 ORDER BY p.ViewCount DESC; -- 閲覧数の多い順に並べる