hard20 pts · first answer countssqlnull-handlingaggregation
GROUP BY with NULL keys
t has (region, amt): (N, 1), (NULL, 2), (S, 3), (NULL, 4). How many rows does the query return, and what is the sum for the NULL region?
SELECT region, SUM(amt) FROM t GROUP BY region;
Discussion 0
Join free to post in the discussion.
Related questions
- Purpose of a primary keyData Engineer
- Row count of a LEFT JOINData Engineer
- Filtering with = NULLData Engineer
- COUNT(*) vs COUNT(column)Data Engineer
- Filtering groups with HAVINGData Engineer
- Adding a number to NULLData Engineer
- Orders pointing to missing customersData Engineer
- avg and count with a null valueData Engineer