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
A column that is neither grouped nor aggregated reads undefined in an expression, HAVING or ORDER BY of a grouped query #3150
constdata=[{g: 1,b: 5},{g: 1,b: 6},{g: 2,b: 7}];alasql('SELECT g, b FROM ? GROUP BY g',[data]);alasql('SELECT g, b + 1 AS c FROM ? GROUP BY g',[data]);alasql('SELECT g FROM ? GROUP BY g HAVING b > 6',[data]);alasql('SELECT g FROM ? GROUP BY g ORDER BY b DESC',[data]);
The bare b reads the first row of each group, but c is missing, HAVING finds no rows and ORDER BY does not sort.
They should read the same row as the bare b, which gives c 6 and 8, the group 2 for HAVING and 2, 1 for ORDER BY, as SQLite does.
Activity