【SQL】SELECT col, COUNT(DISTINCT other_col) FROM tab GROUP BY col的两种写法
To count distinct values inside of a GROUP BY, use the following.
SELECT col, COUNT(DISTINCT other_col) FROM tab GROUP BY col
The same result can be achieved without using the DISTINCT keyword, as ...
翻译
2018-10-26 13:46:42 ·
539 阅读 ·
0 评论