1
我已經得到了執行GROUP BY (col1, col2, col3)
查詢,然後返回計數爲groupByCount
:GROUP BY和計數列是否爲空
+------+------+------+--------------+
| col1 | col2 | col3 | groupByCount |
+------+------+------+--------------+
| 1 | a | A | 2 |
| 2 | b | B | 4 |
| 1 | a | null | 5 |
| 2 | b | null | 3 |
+------+------+------+--------------+
這樣的作品,但它不完全是我後。我想吻合的地方COL3是空的計數或NOT NULL:
+------+------+------+-------------+----------+
| col1 | col2 | col3 | col3notnull | col3null |
+------+------+------+-------------+----------+
| 1 | a | A | 2 | 5 |
| 2 | b | B | 4 | 3 |
| 1 | a | null | 0 | 5 |
| 2 | b | null | 0 | 3 |
+------+------+------+-------------+----------+
是否有執行該計數的方法嗎?