Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ncov
/
back
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
lintry
2020-01-29 23:03:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
58e761da53672612084c5c2cb731df8058fb7be7
58e761da
1 parent
afee6766
取每日最新数据作为当天值
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
server/routers/c/info_action.js
server/routers/c/info_action.js
View file @
58e761d
...
...
@@ -35,12 +35,16 @@ module.exports = function (dbo) {
with days as (
select generate_series('2020-01-24'::date, CURRENT_DATE, '1 days')::date today
)
, ta as (
select country, province_short_name province, update_time, confirmed_count, row_number() over(partition by country, province_short_name order by update_time desc) rn
from tb_mf_timeline_area
)
, stats as (
select country,
province_short_name
province, d.today, max(confirmed_count) confirmed_count
select country,
ta.
province, d.today, max(confirmed_count) confirmed_count
from days d
left join t
b_mf_timeline_area ta on ta.update_time::date = d.today
left join t
a on ta.update_time::date = d.today and ta.rn = 1
where 1=1
and province
_name
~ :province
and province ~ :province
group by 1,2,3
order by 1,2,3
)
...
...
Please
register
or
login
to post a comment