Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with cases where CTE names and physical tables collide #480

Open
mk3008 opened this issue Jul 21, 2024 · 0 comments
Open

Dealing with cases where CTE names and physical tables collide #480

mk3008 opened this issue Jul 21, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mk3008
Copy link
Owner

mk3008 commented Jul 21, 2024

There is a technique to "intentionally" make CTE and physical table names the same. We will deal with this.

Sample

with
sale_summarys as (
    select
        store_id
        , sum(price) as price
    from
        --Physical
        sales
    group by
        store_id
),
sales as (
    select
        *
    from
        --Physical
        sales
)
select
    *
from
    --CTE
    sale_summarys
;
with
sales as (
    select
        *
    from
        --Physical
        sales
),
sale_summarys as (
    select
        store_id
        , sum(price) as price
    from
        --CTE
        sales
    group by
        store_id
)
select
    *
from
    --CTE
    sale_summarys
@mk3008 mk3008 added the enhancement New feature or request label Jul 21, 2024
@mk3008 mk3008 added this to the 0.8.6 milestone Jul 21, 2024
@mk3008 mk3008 self-assigned this Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant