Question

I want to query on a table keeping few fields as disctict. So, I use group by on the fields to be distinct. BUt HANA system throws an error: Not A Group By expression

select "REFID", "ORGID_WE", "ARTIKLE", "ORGID", "HELLER", "WERT", "BZBAS_AW" 
from "SYSTEM"."SOFT"
GROUP BY "REFID", "ORGID_WE", "ARTIKLE", "ORGID", "HELLER" ;

For me this looks good. Any ideas??

Was it helpful?

Solution

try using aggregate functions:

select "REFID", "ORGID_WE", "ARTIKLE", "ORGID", "HELLER", sum("WERT"), sum("BZBAS_AW")
from "SYSTEM"."SOFT"
GROUP BY "REFID", "ORGID_WE", "ARTIKLE", "ORGID", "HELLER" ;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top