You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GROUP BY on field of type INTEGER sometimes loses type #536
create table data( id INTEGER PRIMARY KEY, grp INTEGER);
insert into data select range._ as id , range._ % 3 as grp from RANGE(0,9)as range;
select id, id +1 from data group by id;
select a.id, a.id +1, CAST(a.id AS INTEGER) +1 from data as a, data as b where a.id < b.id and a.grp = b.grp group by a.id
Activity
CBke commentedon Jan 15, 2016
SELECT id, id + 1 FROM data GROUP BY idSELECT a.id, a.id + 1, CONVERT(INT,a.id) + 1 FROM data AS a,data AS b WHERE a.id < b.id AND a.grp = b.grp GROUP BY a.idexpected result
agershun commentedon Jan 15, 2016
Please use variables without table prefix (at current moment it gives correct answer):
I will check details later.
Let GROUP BY support table-prefixed columns in arithmetic expressions…
mathiasrw commentedon Dec 6, 2025
Fix released in v4.11.0