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

Automatic Table Alias Prefixing in SELECT Queries to Avoid Field Name Conflicts #201

Open
pfk84 opened this issue Sep 16, 2024 · 1 comment

Comments

@pfk84
Copy link

pfk84 commented Sep 16, 2024

When running a query like:

SELECT a.*, b.* FROM adam a LEFT JOIN ben b ON a.b_id = b.id
or even just
SELECT * FROM adam a LEFT JOIN ben b ON a.b_id = b.id

it would be really helpful if the result field names were automatically prefixed with the table alias, resulting in names like a.id, a.b_id, a.whatever, b.id, b.whatever. Currently, fields with the same name from the b table overwrite those from the a table in the result set, and you have to manually alias each field, which can be quite cumbersome. What do you think?

@pfk84
Copy link
Author

pfk84 commented Oct 11, 2024

I’m happy to create a pull request if others find this useful. Let me know if there’s interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant