我正在尝试在https://data.stackexchange.com/stackoverflow查询 satckoverflow 数据
SELECT Id as postId, PostTypeId, OwnerUserID, AcceptedAnswerId from posts
where PostTypeId = 1
将给我一个包含 50,000 个问题的列表和发布问题的用户的用户 ID (OwnerUserId) 和回答被接受的人的用户 ID (AcceptedAnswerId)。
现在我正在尝试编写一个查询来选择已询问或发布已接受答案的用户列表。像这样的东西:
Select Id, reputation from users
INNER JOIN
(Select Id as postId, OwnerUserId, AcceptedAnswerId from posts)
ON
users.Id = posts.OwnerUserId or users.Id = posts.AcceptedAnswerId