不是程序员,而是使用 data.stackexchange.com。我正在查询公共 SE 数据资源管理器,并且我指定的列名无效。另外,如何指定计数(帖子)和计数(投票)?是否有人查询 data.se 并知道 db 模式能够帮助我更正此代码?
Select Count (u.Id)
From Users u
Left Join Posts p on u.Id = p.OwnerUserId
Left join SuggestedEdits e on u.Id = e.OwnerUserId
left join Votes v on u.Id = v.UserId
WHERE ((u.CreationDate BETWEEN 'qwerty' AND 'qwerty')
AND (p.CreationDate BETWEEN 'qwerty' AND 'qwerty')
AND (p.ClosedDate is null)
OR (e.CreationDate BETWEEN 'qwerty' AND 'qwerty'))
AND Count (Posts) = x
OR Count (Votes) = y
Group by u.CreationDate, p.OwnerUserId, UserTypeId, u.DisplayName, p.CreationDate