SELECT p.Title as QuestionTitle, p.Body as QuestionBody, ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Skeptics

Q&A for scientific skepticism

SELECT 
    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') -- 特定のトピックに限定
  AND p.CreationDate >= DATEADD(YEAR, -5, GETDATE()) -- 直近5年間に限定
ORDER BY p.ViewCount DESC -- 閲覧数の多い順に並べる
OFFSET 0 ROWS FETCH NEXT 20 ROWS ONLY; -- 上位20件を取得

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results