统计总时间问题,将时间换算成小时,有些地方看不懂,
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:英语作业 时间:2024/08/13 21:52:27
统计总时间问题,将时间换算成小时,有些地方看不懂,
select comcode,count(*) case_qty,
sum(substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S') - p1.reportTime,1,9) * 24 * 3600 +
substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S')- p1.reportTime,11,2) * 3600 +
substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S') - p1.reportTime,14,2) * 60 +
substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S') - p1.reportTime,17,2)) as compensate_secord
from temp_car_claim_pay p1
group by p1.comcode
select comcode,count(*) case_qty,
sum(substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S') - p1.reportTime,1,9) * 24 * 3600 +
substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S')- p1.reportTime,11,2) * 3600 +
substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S') - p1.reportTime,14,2) * 60 +
substr(to_date(to_char(p1.payment_date,'%Y-%m-%d')|| ' 00:00:01','%Y-%m-%d %H:%M:%S') - p1.reportTime,17,2)) as compensate_secord
from temp_car_claim_pay p1
group by p1.comcode
![统计总时间问题,将时间换算成小时,有些地方看不懂,](/uploads/image/z/18741143-47-3.jpg?t=%E7%BB%9F%E8%AE%A1%E6%80%BB%E6%97%B6%E9%97%B4%E9%97%AE%E9%A2%98%2C%E5%B0%86%E6%97%B6%E9%97%B4%E6%8D%A2%E7%AE%97%E6%88%90%E5%B0%8F%E6%97%B6%2C%E6%9C%89%E4%BA%9B%E5%9C%B0%E6%96%B9%E7%9C%8B%E4%B8%8D%E6%87%82%2C)
参考答案\x09和你一同笑过的人,你可能把他忘掉;但是和你一同哭过的人,你却永远不忘.有些事,你把它藏到心里,也许还更好,等时间长了,也就变成了故事.