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

Fix when SELECT columns those have same name in JOIN statement #89

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

qiaoyuang
Copy link
Contributor

If we execute a JOIN (cross join or join with a ON clause) SQL statement:

SELECT person.name, student.name, age, specialized FROM person CROSS JOIN student;

We will get two columns those named "name". Now in NativeCursor, the index of second "name" will replace index of first "name" in columnNames, and users can never get the index of first "name" in columnNames. So, I provide a solution that if columnNames contains the "name", the second "name" will be rename to "name&JOIN1", and If we have three "name", the third will be named to "name&JOIN2", etc..

…e have same name in two tables at JOIN clause
@qiaoyuang qiaoyuang changed the title Fix the behavior of Cursor's columnNames that SELECT the columns thos… Fix when SELECT columns those have same name in JOIN statement Dec 15, 2022
@kpgalligan kpgalligan merged commit 8968474 into touchlab:main Nov 5, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants