i have data like below and where ap_key is same for two different first_occurence column . here i need to write a function which can calculate the difference of two timestamp values for a Ap_Key and then with difference it should multiply the severity
like for 418 time difference is (3/4/2014 0:00 - 3/4/2014/0.05) and it should get multiplied with severity 5 . in this way we need to calculate for every ap_key and store the result in separate table.