I have table name Record which has the following columns, Empid
in number column, dat
in timestamp
Which has the following values
empid dat
====== ====
101 4/9/2012 9:48:54 AM
101 4/9/2012 9:36:28 AM
101 4/9/2012 6:16:28 PM
101 4/10/2012 9:33:48 AM
101 4/10/2012 12:36:28 PM
101 4/10/2012 8:36:12 PM
101 4/11/2012 9:36:28 AM
101 4/11/2012 4:36:22 PM
Here I need to display the following columns,
empid
,min(dat)
as start,max(dat)
as end and difference(max(dat)-min(dat)
for each day
Here 3 different days are exists so It should return 3 records with the above mentioned columns.
Please give some ways to get this.