79510228

Date: 2025-03-14 21:15:56
Score: 1.5
Natty:
Report link

I agree to the answer of @Charlieface, then if you don't want NULL order_date value in the result you may declare it as IFNULL(order_date, 'any date or value') AS order_date, and for country having NULL values as well IFNULL(country, ''EU' or 'All' or something') AS country.

As a reminder GROUPING SETS intentionally produces NULL values when columns are not included in a particular grouping combination.

Having NULL values is not an error; it's a fundamental part of how GROUPING SETS works.

It is very common to use the COALESCE or IFNULL functions along with GROUPING SETS to convert the null values to another value.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @Charlieface
  • Low reputation (0.5):
Posted by: McMaco