excel - How can I group records and do calculations between first and last records in each group using Oracle SQL? -
i have table in oracle 10g db engine contains records of service operations. requirement calculate processing time of each service request. each service request may generate multiple records each representing step in process. have table following columns:
id created_on service_operation result fk_service_request_id
where last column identifier of service requests.
how can calculate difference between created_on
of first , last records in each group identified fk_service_request_id
? better off do:
select fk_service_request_id, created_on, service_operation, result table order fk_service_request_id, id;
and tricks in excel? if so, how can achieve in excel?
select fk_service_request_id, min(created_on) min_dt, max(created_on) max_dt, max(created_on)-min(created_on) proc_time table group fk_service_request_id order fk_service_request_id;
Comments
Post a Comment