Need Help on SQL

Database
Highlighted
Enthusiast

Need Help on SQL

Hi Folks,

 

I have a business requirement to fetch max(endtime) and max(enddatetime) for both rows mentioned below which means we need two rows in target table with max(endtime) and max(enddatetime) and SUM(cols) please help me with the SQL and do the needful.

 

UPI=group by cols

 

 UPIUPI  UPIUPIUPIUPIUPIMAXMAXUPISUMSUMSUMSUMSUMSUMSUMSUMUPI   
PERFMNC_IDUSERIDACTIVITYNAMESTARTTIMEDATESTARTTIMESTARTDATELOC_IDASSIGNMENTIDISDIRECTEQPTYPEDESCENDTIMEDATEENDTIMEENDDATEKVI2KVI3KVI4TOTALTRAVELDISTANCEACTUALTIMETOTALTRAVELTIMEWITHPFDTOTALKVITIMEWITHPFDGOALTIMEWITHPFDDEL_FLG_VALDW_SRCE_IDDW_CRTD_DTMDW_UPDT_DTM
56,370,942DonnellFULL46:45.046:45.02/1/20192601000260 Riding Pallet Jack54:46.054:46.02/1/2019100048100001005/13/2019 13:215/13/2019 13:21
56,349,371DonnellFULL45:59.045:59.02/1/20192601000260 Riding Pallet Jack46:45.046:45.02/1/201900004600001005/13/2019 13:215/13/2019 13:21