i need to find the difference between the time in the format hh:mm:ss
select msglog.id,max(msglog.timestamp) enddate, min(msglog.timestamp) startdate, en
To get the diff in seconds you can use this
select round(24 * 60 * 60* (TO_DATE('2017/02/17 9:32:25', 'YYYY/MM/DD HH:MI:SS') - TO_DATE('2017/02/17 8:30:30', 'YYYY/MM/DD HH:MI:SS'))) from dual;