Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Group by alias (alias name is the same as column name) #524

Closed
kuba-- opened this issue Nov 1, 2018 · 0 comments
Closed

Group by alias (alias name is the same as column name) #524

kuba-- opened this issue Nov 1, 2018 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kuba--
Copy link
Contributor

kuba-- commented Nov 1, 2018

If alias is a column name then group by queries doesn't work:

SELECT commit_hash AS `commit_hash` FROM commits GROUP BY commit_hash;

SELECT SUBSTRING(`commits`.`commit_hash`, 1, 1024) AS `commit_hash` FROM commits GROUP BY commit_hash;

we get an error: unknown error: table "commits" does not have column "commit_hash"

if we change alias name to something else, e.g.:
SELECT commit_hash AS foo FROM commits GROUP BY foo;

Everything works fine.

@kuba-- kuba-- added the bug Something isn't working label Nov 1, 2018
@kuba-- kuba-- self-assigned this Nov 2, 2018
@kuba-- kuba-- added the help wanted Extra attention is needed label Nov 2, 2018
@kuba-- kuba-- closed this as completed Nov 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant