0
我收集點擊在一個簡單的表格計數被點擊的鏈接,在SQL
user_id | count | meta
=====================================
1 | 3 | http://google.com
1 | 2 | http://twitter.com
2 | 1 | http://google.com
3 | 2 | http://example.com
4 | 1 | http://google.com
現在總的和獨特的我想知道
- 有多少用戶點擊了(至少一次 - 唯一)
- 用戶多久點擊任何鏈接(總)
輸出應該
uniq | total
=============
4 | 9
目前我有
SELECT COUNT(DISTINCT count) AS uniq, SUM(count) AS total FROM my_table
但結果是獨特的用戶不要:
omg,我失明瞭... – Xaver