What do COUNT(*), COUNT(x), and COUNT(DISTINCT x) return?
Table iv_t1 contains four rows. The query uses three different counting methods. What numbers will it return?
Predict the resultNULLJuniorAnalystData EngineerBackendQA
Input data · iv_t1
| x |
|---|
| 1 |
| 1 |
| 2 |
| NULL |
Query
SELECT COUNT(*) AS count_all,
COUNT(x) AS count_x,
COUNT(DISTINCT x) AS count_distinct
FROM iv_t1