垃圾桶的空闲爆满情况/利用率分析

2024-02-21 18:38

本文主要是介绍垃圾桶的空闲爆满情况/利用率分析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

满载:
select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m 
where m.WEIGHT BETWEEN 23.2265 and 27.29 order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc;空闲:
select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from 
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m 
where m.WEIGHT BETWEEN 0.2 and 13.745 order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc;select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT,
row_number() over(partition by m.GARDENNAME,m.THROWTIME order by m.WEIGHT desc) from 
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m 
order by m.DEVICECODE,m.SYS_KEY,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc;select m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT,
row_number() over(partition by m.GARDENNAME,m.THROWTIME order by m.WEIGHT desc) from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m 
order by m.GARDENNAME,m.GARBAGETYPE,m.SYS_KEY,m.THROWTIME,m.WEIGHT asc;按照垃圾分类求重量最大值、最小值、空闲、满载:
select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE;按照垃圾分类求重量满载:
select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m,
(select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,
(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE) n  
where m.GARBAGETYPE = n.GARBAGETYPE and m.WEIGHT BETWEEN n.mz and n.zd order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc;按照垃圾分类求重量空闲:
select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m,
(select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,
(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE) n  
where m.GARBAGETYPE = n.GARBAGETYPE and m.WEIGHT BETWEEN n.zx and n.kx order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc;求满载次数:
select q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME,count(*) as mz_cs from 
(select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m,
(select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,
(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE) n  
where m.GARBAGETYPE = n.GARBAGETYPE and m.WEIGHT BETWEEN n.mz and n.zd order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc) q 
GROUP BY q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME order by q.DEVICECODE;
求空闲次数:
select q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME,count(*) as kx_cs from 
(select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m,
(select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,
(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE) n  
where m.GARBAGETYPE = n.GARBAGETYPE and m.WEIGHT BETWEEN n.zx and n.kx order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc) q
GROUP BY q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME order by q.DEVICECODE求一个月内空闲次数:
select q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME,count(*) as kx_cs from 
(select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m,
(select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,
(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE) n  
where m.GARBAGETYPE = n.GARBAGETYPE and m.WEIGHT BETWEEN n.zx and n.kx order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc) q
GROUP BY q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME having substr(q.THROWTIME,1,7) = substr(TO_CHAR(sysdate,'yyyy-mm-dd hh24:mi:ss'),1,7);求一周内空闲次数:
select q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME,count(*) as kx_cs from 
(select m.DEVICECODE,m.SYS_KEY,m.GARDENNAME,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT from  
(select DEVICECODE,SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) m,
(select p.GARBAGETYPE,max(p.WEIGHT) as zd,min(p.WEIGHT) as zx,((max(p.WEIGHT)+min(p.WEIGHT))*0.5) as kx,
(0.85*max(p.WEIGHT)+0.15*min(p.WEIGHT)) as mz from 
(select SYS_KEY,GARDENNAME,GARBAGETYPE,THROWTIME,to_number(WEIGHT) as WEIGHT from TFJL_COPY) p
GROUP BY p.GARBAGETYPE) n  
where m.GARBAGETYPE = n.GARBAGETYPE and m.WEIGHT BETWEEN n.zx and n.kx order by m.DEVICECODE,m.GARBAGETYPE,m.THROWTIME,m.WEIGHT asc) q
GROUP BY q.DEVICECODE,q.GARDENNAME,q.GARBAGETYPE,q.THROWTIME 
having trunc(TO_DATE(THROWTIME, 'yyyy-mm-dd hh24:mi:ss'))<=trunc(Sysdate) and trunc(TO_DATE(THROWTIME, 'yyyy-mm-dd hh24:mi:ss'))>= trunc(sysdate-7);求上一周的数据
Select * From TFJL_COPY a Where trunc(TO_DATE(THROWTIME, 'yyyy-mm-dd hh24:mi:ss'))>=trunc(Sysdate,'d')
AND trunc(TO_DATE(THROWTIME, 'yyyy-mm-dd hh24:mi:ss'))<= Next_day(trunc(sysdate,'d'),7);求当前日期前七天的数据
Select * From TFJL_COPY a Where trunc(TO_DATE(THROWTIME, 'yyyy-mm-dd hh24:mi:ss'))<=trunc(Sysdate) 
and trunc(TO_DATE(THROWTIME, 'yyyy-mm-dd hh24:mi:ss'))>= trunc(sysdate-7);删除多字段重复数据
DELETE FROM TFJL_COPY_COPY a
WHERE (a.DEVICECODE, a.THROWTIME,a.GARBAGETYPE,a.WEIGHT) IN 
(SELECT DEVICECODE,THROWTIME,GARBAGETYPE,WEIGHT FROM TFJL_COPY_COPY GROUP BY DEVICECODE,THROWTIME,GARBAGETYPE,WEIGHT HAVING COUNT(*) > 1)
AND ROWID NOT IN (SELECT MIN(ROWID) FROM TFJL_COPY_COPY GROUP BY DEVICECODE,THROWTIME,GARBAGETYPE,WEIGHT HAVING COUNT(*) > 1);查找多字段重复数据
SELECT * FROM TFJL_COPY_COPY a WHERE (a.DEVICECODE, a.THROWTIME,a.GARBAGETYPE,a.WEIGHT) IN (SELECT DEVICECODE,THROWTIME,GARBAGETYPE,WEIGHT
FROM TFJL_COPY_COPY GROUP BY DEVICECODE,THROWTIME,GARBAGETYPE,WEIGHT HAVING COUNT(*) > 1);

 

这篇关于垃圾桶的空闲爆满情况/利用率分析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/732700

相关文章

Spring事务中@Transactional注解不生效的原因分析与解决

《Spring事务中@Transactional注解不生效的原因分析与解决》在Spring框架中,@Transactional注解是管理数据库事务的核心方式,本文将深入分析事务自调用的底层原理,解释为... 目录1. 引言2. 事务自调用问题重现2.1 示例代码2.2 问题现象3. 为什么事务自调用会失效3

找不到Anaconda prompt终端的原因分析及解决方案

《找不到Anacondaprompt终端的原因分析及解决方案》因为anaconda还没有初始化,在安装anaconda的过程中,有一行是否要添加anaconda到菜单目录中,由于没有勾选,导致没有菜... 目录问题原因问http://www.chinasem.cn题解决安装了 Anaconda 却找不到 An

Spring定时任务只执行一次的原因分析与解决方案

《Spring定时任务只执行一次的原因分析与解决方案》在使用Spring的@Scheduled定时任务时,你是否遇到过任务只执行一次,后续不再触发的情况?这种情况可能由多种原因导致,如未启用调度、线程... 目录1. 问题背景2. Spring定时任务的基本用法3. 为什么定时任务只执行一次?3.1 未启用

C++ 各种map特点对比分析

《C++各种map特点对比分析》文章比较了C++中不同类型的map(如std::map,std::unordered_map,std::multimap,std::unordered_multima... 目录特点比较C++ 示例代码 ​​​​​​代码解释特点比较1. std::map底层实现:基于红黑

浅析CSS 中z - index属性的作用及在什么情况下会失效

《浅析CSS中z-index属性的作用及在什么情况下会失效》z-index属性用于控制元素的堆叠顺序,值越大,元素越显示在上层,它需要元素具有定位属性(如relative、absolute、fi... 目录1. z-index 属性的作用2. z-index 失效的情况2.1 元素没有定位属性2.2 元素处

查看Oracle数据库中UNDO表空间的使用情况(最新推荐)

《查看Oracle数据库中UNDO表空间的使用情况(最新推荐)》Oracle数据库中查看UNDO表空间使用情况的4种方法:DBA_TABLESPACES和DBA_DATA_FILES提供基本信息,V$... 目录1. 通过 DBjavascriptA_TABLESPACES 和 DBA_DATA_FILES

Spring、Spring Boot、Spring Cloud 的区别与联系分析

《Spring、SpringBoot、SpringCloud的区别与联系分析》Spring、SpringBoot和SpringCloud是Java开发中常用的框架,分别针对企业级应用开发、快速开... 目录1. Spring 框架2. Spring Boot3. Spring Cloud总结1. Sprin

Spring 中 BeanFactoryPostProcessor 的作用和示例源码分析

《Spring中BeanFactoryPostProcessor的作用和示例源码分析》Spring的BeanFactoryPostProcessor是容器初始化的扩展接口,允许在Bean实例化前... 目录一、概览1. 核心定位2. 核心功能详解3. 关键特性二、Spring 内置的 BeanFactory

MyBatis-Plus中Service接口的lambdaUpdate用法及实例分析

《MyBatis-Plus中Service接口的lambdaUpdate用法及实例分析》本文将详细讲解MyBatis-Plus中的lambdaUpdate用法,并提供丰富的案例来帮助读者更好地理解和应... 目录深入探索MyBATis-Plus中Service接口的lambdaUpdate用法及示例案例背景

MyBatis-Plus中静态工具Db的多种用法及实例分析

《MyBatis-Plus中静态工具Db的多种用法及实例分析》本文将详细讲解MyBatis-Plus中静态工具Db的各种用法,并结合具体案例进行演示和说明,具有很好的参考价值,希望对大家有所帮助,如有... 目录MyBATis-Plus中静态工具Db的多种用法及实例案例背景使用静态工具Db进行数据库操作插入