Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

database - Custom division in SQL

I'm a beginer with Metabase and I'd like to display the average number of calendly_event per week between January 1th 2021 and January 1th 2022.

So far I only managed to display the total count of calendly_event for this period but i can't find a way to divide it by the number of weeks between today and January 1th 2021.

SELECT count(*) AS "count"
FROM "public"."calendly_events"
WHERE ("public"."calendly_events"."state" = 'happened'
   AND ("public"."calendly_events"."end_time" >= timestamp with time zone '2021-01-01 00:00:00.000+01:00' AND "public"."calendly_events"."end_time" < timestamp with time zone '2022-01-02 00:00:00.000+01:00'))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...