我不明白为什么这不起作用以及如何解决它,我尝试了各种方法,例如写作
select COUNT(p.OwnerUserId)
但这不起作用,我不明白错误消息。我不使用 MS SQL(我使用 SQLite 和 MySQL)。
如何编写此查询,以便我可以按 10 或 50 过滤 QC?(其中 QC > 50 并且 ...)
基本上将下面的 SQL 插入到这个 URL 中,运行它,你会在结果中看到 1。 https://data.stackexchange.com/stackoverflow/query/new
SELECT
TOP 100
p.OwnerUserId AS [User Link],
sum(ViewCount) as VC,
avg(ViewCount) as AVC,
COUNT(p.OwnerUserId ) as QC
FROM Posts p
join Users on p.OwnerUserId = Users.Id
where PostTypeId = 1 and ViewCount<10000 and CommunityOwnedDate is null
group by p.OwnerUserId
order by AVC desc