Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c066b8

Browse files
committed
WIP
1 parent ee7cca5 commit 0c066b8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

coderd/database/queries/insights.sql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ WITH d AS (
9393
)
9494
GROUP BY ts.from_, ts.to_, was.user_id
9595
), template_ids AS (
96-
SELECT
97-
template_usage_by_day.from_,
98-
array_agg(template_usage_by_day.template_id) AS ids
99-
FROM (
100-
SELECT DISTINCT
101-
from_,
102-
template_id
103-
FROM usage_by_day, unnest(template_ids) template_id
104-
WHERE template_id IS NOT NULL
105-
) AS template_usage_by_day
106-
GROUP BY template_usage_by_day.from_
96+
SELECT
97+
template_usage_by_day.from_,
98+
array_agg(template_id) AS ids
99+
FROM (
100+
SELECT DISTINCT
101+
from_,
102+
unnest(template_ids) AS template_id
103+
FROM usage_by_day
104+
WHERE usage_by_day.template_ids IS NOT NULL
105+
) AS template_usage_by_day
106+
GROUP BY template_usage_by_day.from_
107107
)
108108

109109
SELECT

0 commit comments

Comments
 (0)