Open l1t1 opened 4 years ago
you can update these value with following command , and save the data to a new csv file
update ncov as a set continentname=
(select distinct b.continentname from ncov as b where continentname<>'NA' and b.provincename=a.provincename)
where continentname='NA';
.once newcov.csv
select * from ncov;
and use this command to get a dataset of last record of everyday data
.once dailyncov.csv
with t as(select substr(updateTime,1,10)dt,province_confirmedCount,province_suspectedCount,province_curedCount,province_deadCount ,continentName,provinceName
from ncov where (updateTime,continentName,provinceName,substr(updateTime,1,10)) in
(select max(updateTime)tm,continentName,provinceName,substr(updateTime,1,10) from ncov group by continentName,provinceName,substr(updateTime,1,10)))
select * from t;
Thanks. The origin data is from here. I am not familar with sqlite, and if necessary the missing continentname field value can be fixed by comparing the continentname field in the newer data.
I load the data into sqlite database with following command
NA,NA,"俄罗斯",Russia,"俄罗斯",Russia,964006,2,0,0,0,2020-01-31T21:09:48Z,NA,NA,NA,NA,NA,NA,NA NA,NA,"泰国",Thailand,"泰国",Thailand,952010,19,0,5,0,2020-01-31T18:27:47Z,NA,NA,NA,NA,NA,NA,NA ...