I am new to the MapD community and my SQL is a bit rusty.
I am having trouble with a GROUP BY despite using a MIN aggregator.
create table sample (A INT, B INT, D INT)
insert into sample values (1, 42, 20)
insert into sample values (1, 43, 10)
insert into sample values (2, 44, 50)
insert into sample values (2, 45, 25)
select A, B, min(D) from sample group by A
I was expecting:
1, 43, 10
2, 45, 25
But I get an error msg:
Exception: Exception occurred: org.apache.calcite.runtime.CalciteContextException: From line 1, column 13 to line 1, column 15: Expression ‘B’ is not being grouped
I am using MapD Cloud btw.
Any help or pointer would be welcome.