这是我的表/输出的样子:
ID ID_2 Status Timestamp
------- ----------- ------------------- --------------------
4613840 19668170 Submitted 05-06-2015 16:37:00
4613840 19668330 Submitted 05-06-2015 16:44:00
4613840 19668409 In Progress 05-06-2015 16:48:00
4613840 19669674 SupplierPend 05-06-2015 17:43:00
4613840 19705863 SupplierPend 09-06-2015 15:01:00
4613840 19735270 In Progress 12-06-2015 11:38:00
4613840 19735282 Information Pend 12-06-2015 11:38:00
4613840 19735383 Closed 12-06-2015 11:42:00
我需要在末尾添加另一列,其中包含日期之间的差异(以分钟为单位)。
预期输出:
ID ID_2 Status Timestamp Result
------- ----------- ------------------- ------------------- ---------
4613840 19668170 Submitted 05-06-2015 16:37:00 0:07:00
4613840 19668330 Submitted 05-06-2015 16:44:00 0:04:00
4613840 19668409 In Progress 05-06-2015 16:48:00 0:55:00
4613840 19669674 SupplierPend 05-06-2015 17:43:00 93:18:00
4613840 19705863 SupplierPend 09-06-2015 15:01:00 68:37:00
4613840 19735270 In Progress 12-06-2015 11:38:00 0:00:00
4613840 19735282 Information Pend 12-06-2015 11:38:00 0:04:00
4613840 19735383 Closed 12-06-2015 11:42:00
ID 19668330
第一行的结果是 timestamp with和 timestamp with之间的差异ID 19668170
。