获取流域每隔1小时累计平均降雨量
来源:互联网 发布:猜你喜欢 人工智能 编辑:程序博客网 时间:2024/05/16 08:35
with data as (
select rtrim(a.wcpcode) as stcd,b.lareasize as area,lname as name,lcode as code from SS_MESHING_GRIDSLGC_RELATION a
inner join SS_MESHING_GRID_BASIN b on a.ennmcd = b.lcode
where wcptype in (5,6)
), real as (
select a.*,b.area,b.name,b.code from (
select a.stcd,a.drp,a.duration,a.begin_time from (
select rtrim(stcd) stcd,drp, to_char(tm, 'yyyy/MM/dd hh24') as duration,
to_char(tm, 'yyyy/MM/dd hh24')||':00:00' as begin_time
from st_pptn_r where tm>@begin_time@ and tm<=@end_time@
and (intv='1.00' or intv is null) group by stcd,drp,tm
) a
) a
inner join data b on a.stcd=b.stcd
)
select a.*,b.name, @end_time@ as end_time
from (
select code,duration,begin_time,area,stcd_count,zslj,rain_val,cast( rain_val*area*0.1 as number(9,1) ) water_val from(
select cast(sum(rain_val)over(partition by code order by duration range unbounded preceding) as number(9,1) ) as rain_val,
code,begin_time,duration,area,stcd_count,zslj from (
select code,duration,area,stcd_count,begin_time,zslj,cast( zslj/stcd_count as number(9,1) ) as rain_val
from(
select t2.stcd_count,t1.code,t1.duration,t1.begin_time,t1.area,sum(t1.drp)over(partition by t1.duration order by t1.duration range unbounded preceding) as zslj
from real t1
inner join
(select count(stcd) as stcd_count,code,duration from real group by code,duration,begin_time) t2 on t1.code=t2.code and t1.duration=t2.duration
) group by code,duration,area,zslj,stcd_count,begin_time
)
)
) a inner join (SELECT NAME,CODE FROM data GROUP BY NAME,CODE) b on a.code=b.code
ORDER BY a.code,DURATION
select rtrim(a.wcpcode) as stcd,b.lareasize as area,lname as name,lcode as code from SS_MESHING_GRIDSLGC_RELATION a
inner join SS_MESHING_GRID_BASIN b on a.ennmcd = b.lcode
where wcptype in (5,6)
), real as (
select a.*,b.area,b.name,b.code from (
select a.stcd,a.drp,a.duration,a.begin_time from (
select rtrim(stcd) stcd,drp, to_char(tm, 'yyyy/MM/dd hh24') as duration,
to_char(tm, 'yyyy/MM/dd hh24')||':00:00' as begin_time
from st_pptn_r where tm>@begin_time@ and tm<=@end_time@
and (intv='1.00' or intv is null) group by stcd,drp,tm
) a
) a
inner join data b on a.stcd=b.stcd
)
select a.*,b.name, @end_time@ as end_time
from (
select code,duration,begin_time,area,stcd_count,zslj,rain_val,cast( rain_val*area*0.1 as number(9,1) ) water_val from(
select cast(sum(rain_val)over(partition by code order by duration range unbounded preceding) as number(9,1) ) as rain_val,
code,begin_time,duration,area,stcd_count,zslj from (
select code,duration,area,stcd_count,begin_time,zslj,cast( zslj/stcd_count as number(9,1) ) as rain_val
from(
select t2.stcd_count,t1.code,t1.duration,t1.begin_time,t1.area,sum(t1.drp)over(partition by t1.duration order by t1.duration range unbounded preceding) as zslj
from real t1
inner join
(select count(stcd) as stcd_count,code,duration from real group by code,duration,begin_time) t2 on t1.code=t2.code and t1.duration=t2.duration
) group by code,duration,area,zslj,stcd_count,begin_time
)
)
) a inner join (SELECT NAME,CODE FROM data GROUP BY NAME,CODE) b on a.code=b.code
ORDER BY a.code,DURATION
0 0
- 获取流域每隔1小时累计平均降雨量
- 读取流域平均降雨累计值
- 降雨量
- VMware ESXi中Windows Server 2008 R2虚拟机每隔1小时自动重启
- Kronos获取累计池数量
- 累计
- SQL语句实现:输入开始和结束时间,得到1小时间隔的平均数据。
- 有小时、分钟,求平均工作时间。
- 生成当天每隔n小时的时间列表
- Spring-Quertz配置每隔三个小时执行一次函数
- 解决MySQL每隔8小时自动断开连接的问题
- 查出某个特定时间一小时内,两小时内,N小时内的累计和
- 获取访问量(重复IP不累计)
- iOS NSProcessInfo获取系统开机累计时间
- IOS NSProcessInfo获取系统开机累计时间
- 每隔一段时间获取一次gps信息
- Java获取当前小时
- sql分钟数据求平均得到小时数据
- linux下的du命令
- pat 表达式转换
- mui开箱即用超原生体验的框架
- 各种编码是什么东西?(iso-8859-1 、gbk、gb2312、UniCode、ASCII、URL、URI)
- Javascript:apply()和call()方法深入理解
- 获取流域每隔1小时累计平均降雨量
- 图片裁剪
- CSS3中弹性盒子Flex使用
- redis初识
- 单元测试、集成测试、系统测试的侧重点是什么?
- 求两个数的最大公约数
- GCC编译器
- 常用注解及属性
- 爬取武汉大学教务系统数据