Skip to content
Advertisement

include “0” count result in clickhouse

I have one t_table(some_date, id), and i want get count of ids for each day between two input dates.

I try this query:

This query returns day only if id has (some_date) for this day. I want get column of all days between input dates, and if no id in some day in ids column put 0 to that cell.

I think that needed to use some join, but i don’t know what join with.

Advertisement

Answer

order by … with fill

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement