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

Skip to content

Commit 540efbd

Browse files
committed
fix
1 parent 9ae9b41 commit 540efbd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coderd/database/queries/insights.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ WITH d AS (
9494
GROUP BY ts.from_, ts.to_, was.user_id
9595
), template_ids AS (
9696
SELECT
97-
from_,
97+
template_usage_by_day.from_,
9898
array_agg(DISTINCT id) AS ids
9999
FROM (
100-
SELECT from_, unnest(ids) AS id
100+
SELECT template_usage_by_day_unnested.from_, unnest(ids) AS id
101101
FROM (
102102
SELECT DISTINCT
103103
from_,
@@ -107,7 +107,7 @@ WITH d AS (
107107
GROUP BY from_, template_ids
108108
) AS template_usage_by_day_unnested
109109
) AS template_usage_by_day
110-
GROUP BY from_
110+
GROUP BY template_usage_by_day.from_
111111
)
112112

113113
SELECT

0 commit comments

Comments
 (0)