Skip to content

Commit d2c8a6b

Browse files
committed
having
1 parent c7458e6 commit d2c8a6b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

grafana_queries.sql

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ with cost_per_project as (
66
invoice_date
77
from
88
cost
9-
where
10-
cost > 10 -- only consider services where the cost is > 10
119
group by
1210
2,3
11+
having
12+
sum(cost) > 10 -- only consider services where the cost is > 10
1313
),
1414
lag_cost_per_project as (
1515
select
@@ -48,9 +48,10 @@ with cost_per_service as (
4848
invoice_date
4949
from
5050
cost
51-
where
52-
cost > 10 -- only consider projects where the cost is > 10
53-
group by 2,3
51+
group by
52+
2,3
53+
having
54+
sum(cost) > 10 -- only consider services where the cost is > 10
5455
),
5556
lag_cost_per_service as (
5657
select

0 commit comments

Comments
 (0)