Hello,
I am currently in a dev / testing environment with my dbt project.
Therefore, there is currently no need to write explicit select statements.
What I am trying to do is joining 3 tables like this:
with
sales as (
select
*
from {{ref('stg_itemsale')}}
),
items as (
select
*
from {{ref('stg_item')}}
),
epids as (
select
*
from {{ref('stg_epid')}}
),
final as (
select
*
from sales
left join items
on
sales.item = items.item
and sales.variation_id = items.variation
left join epids
on
items.epid = epids.epid
)
select
sales.id, items.id, epids.id
from final
However, I get returned an error when I run “dbt run” saying that the column “id” is specified more than once.
Previously, I have been using Sqlite for my testing phase and it automatically sets a prefix of the table name (sales.id, items.id, epids.id) to avoid having multiple columns named id.
Can I ask dbt to behave similarly?
I know this is not best practice but for testing something fast, it saves a lot of time.