Skip to content

Commit 8ebbc1e

Browse files
authored
Merge branch 'main' into more_generic
2 parents 8b69516 + b08b27e commit 8ebbc1e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

models/customers.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ customer_orders as (
2626
count(order_id) as number_of_orders
2727
from orders
2828

29-
group by 1
29+
group by customer_id
3030

3131
),
3232

@@ -41,7 +41,7 @@ customer_payments as (
4141
left join orders on
4242
payments.order_id = orders.order_id
4343

44-
group by 1
44+
group by orders.customer_id
4545

4646
),
4747

models/orders.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ order_payments as (
2525

2626
from payments
2727

28-
group by 1
28+
group by order_id
2929

3030
),
3131

@@ -47,6 +47,7 @@ final as (
4747

4848
from orders
4949

50+
5051
left join order_payments
5152
on orders.order_id = order_payments.order_id
5253

models/staging/stg_payments.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ renamed as (
1515
order_id,
1616
payment_method,
1717

18-
--`amount` is currently stored in cents, so we convert it to dollars
18+
-- `amount` is currently stored in cents, so we convert it to dollars
1919
amount / 100 as amount
2020

2121
from source

0 commit comments

Comments
 (0)