git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How filter entries in group by max value of column?


Hi! I want execute groupBy request with filtering rows by max value of one column. 

If raw data is:

datetime, colA, colB, value
2018-12-01 04:00:00.0,ABC,001239,15.0
2018-12-01 04:00:00.0,ABC,073228,5.0
2018-12-01 04:00:00.0,ABC,117780,15.0
2018-12-01 05:00:00.0,ABC,073228,18.0
2018-12-01 06:00:00.0,ABC,073228,56.0
2018-12-01 06:00:00.0,CBA,001239,72.0

I want grouping by datetime and colA. Response will be:

datetime, colA, colB, value
2018-12-01 04:00:00.0,ABC,117780,15.0
2018-12-01 05:00:00.0,ABC,073228,18.0
2018-12-01 06:00:00.0,ABC,073228,56.0
2018-12-01 06:00:00.0,CBA,001239,72.0

How do it?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxx