Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
not all dbs support 'using'
Browse files Browse the repository at this point in the history
  • Loading branch information
dataders committed Sep 7, 2021
1 parent b4265b5 commit 8b69516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions models/customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ customer_payments as (

from payments

left join orders using (order_id)
left join orders on
payments.order_id = orders.order_id

group by 1

Expand All @@ -57,9 +58,11 @@ final as (

from customers

left join customer_orders using (customer_id)
left join customer_orders
on customers.customer_id = customer_orders.customer_id

left join customer_payments using (customer_id)
left join customer_payments
on customers.customer_id = customer_payments.customer_id

)

Expand Down
3 changes: 2 additions & 1 deletion models/orders.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ final as (

from orders

left join order_payments using (order_id)
left join order_payments
on orders.order_id = order_payments.order_id

)

Expand Down

0 comments on commit 8b69516

Please sign in to comment.