Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am running this sqript using SUM and GROUP BY function in a load statement:
LOAD
StringKey1 as ContLONumber,
StringKey4 as ContSequence,
Status as ContStatus,
Sum("Time") as ContLogTime
Group By StringKey1;
SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog where StringKey6='CONT';
When executing the sqript I'll got the error message "invalid expression"
What is not correct in my sqript?
If you use a Group By, ALL the non-aggregated fields must be in the Group By list. So this should work
LOAD
StringKey1 as ContLONumber,
StringKey4 as ContSequence,
Status as ContStatus,
Sum("Time") as ContLogTime
Group By StringKey1, StringKey4, Status;
SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog where StringKey6='CONT';
If you use a Group By, ALL the non-aggregated fields must be in the Group By list. So this should work
LOAD
StringKey1 as ContLONumber,
StringKey4 as ContSequence,
Status as ContStatus,
Sum("Time") as ContLogTime
Group By StringKey1, StringKey4, Status;
SQL SELECT * FROM "MyL_PROD_220".OTSDATA.TimeLog where StringKey6='CONT';
Thanks a lot Jonathan! Now it works and I understand the "Group By" statement