5

我试图得到这个结果:

NULL    350
google  98
yahoo   5
bing    4

使用此查询:

SELECT engine, COUNT(engine) AS count
FROM visits
GROUP BY engine
ORDER BY count DESC

但它返回:

google  98
yahoo   5
bing    4
NULL    0

我该如何解决这个问题?

4

1 回答 1

3

改用COUNT(1)

SELECT engine, COUNT(1) AS count
FROM visits
GROUP BY engine
ORDER BY count DESC;
于 2013-09-05T12:14:10.913 回答