记录学习过程中遇到的sql语句
学习过程中遇到的sql语句
一、US_2019COVID项目中
1. 计算每日较昨日新增确诊病例数和死亡数
自连接,新增数=今日-昨日 连接条件:t1.date=t2.date+1
select t1.date,t1.cases-t2.cases as caseIncrease,t1.deaths-t2.deaths as deathIncrease
from ustotal t1,ustotal t2
where t1.date=date_add(t2.date,1)
2. 统计截止
原创
2020-09-17 16:02:50 ·
307 阅读 ·
0 评论