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

Getting an error message regarding a non-GROUP-BY column rather than an unknown identifier #6141

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-12-13 22:18:45 +0100
From: @eyalroz
To: SQL devs <>
Version: 11.23.13 (Jun2016-SP2)
CC: @kutsurak, @mlkersten, @njnes

Last updated: 2017-03-03 10:24:36 +0100

Comment 24770

Date: 2016-12-13 22:18:45 +0100
From: @eyalroz

User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Build Identifier:

Suppose we have a table t1 with a column c2. Now, consider the query:

select count(c1) as c2 from (select count(*) AS c1, c2 from t1 group by c2) AS t2 group by c2;

This is a silly query but a valid one. Now, suppose we introduce the following typo:

select count(c1_) as c2 from (select count(*) AS c1, c2 from t1 group by c2) AS t2 group by c2;

this query has a typo - c1_ instead of c1. The error message we should be getting is:

SELECT: identifier 'c1_' unknown

but instead we get:

SELECT: cannot use non GROUP BY column 'c1_' in query results without an aggregate function

which suggests that c1_ is an actual column, which just can't be used as it is.

Reproducible: Always

Comment 24940

Date: 2017-02-01 21:12:23 +0100
From: MonetDB Mercurial Repository <>

Changeset 796b82e6111d made by Niels Nes in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=796b82e6111d

Changeset description:

fixes for bug #6141 (ie improved error messages)

Comment 24941

Date: 2017-02-01 21:13:45 +0100
From: @njnes

fixed error message

Comment 25122

Date: 2017-03-03 10:24:36 +0100
From: @sjoerdmullender

Dec2016-SP2 has been released, incorporating the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant