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

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

相关文章

Redis主从/哨兵机制原理分析

《Redis主从/哨兵机制原理分析》本文介绍了Redis的主从复制和哨兵机制,主从复制实现了数据的热备份和负载均衡,而哨兵机制可以监控Redis集群,实现自动故障转移,哨兵机制通过监控、下线、选举和故... 目录一、主从复制1.1 什么是主从复制1.2 主从复制的作用1.3 主从复制原理1.3.1 全量复制

Redis主从复制的原理分析

《Redis主从复制的原理分析》Redis主从复制通过将数据镜像到多个从节点,实现高可用性和扩展性,主从复制包括初次全量同步和增量同步两个阶段,为优化复制性能,可以采用AOF持久化、调整复制超时时间、... 目录Redis主从复制的原理主从复制概述配置主从复制数据同步过程复制一致性与延迟故障转移机制监控与维

Redis连接失败:客户端IP不在白名单中的问题分析与解决方案

《Redis连接失败:客户端IP不在白名单中的问题分析与解决方案》在现代分布式系统中,Redis作为一种高性能的内存数据库,被广泛应用于缓存、消息队列、会话存储等场景,然而,在实际使用过程中,我们可能... 目录一、问题背景二、错误分析1. 错误信息解读2. 根本原因三、解决方案1. 将客户端IP添加到Re

Redis主从复制实现原理分析

《Redis主从复制实现原理分析》Redis主从复制通过Sync和CommandPropagate阶段实现数据同步,2.8版本后引入Psync指令,根据复制偏移量进行全量或部分同步,优化了数据传输效率... 目录Redis主DodMIK从复制实现原理实现原理Psync: 2.8版本后总结Redis主从复制实

锐捷和腾达哪个好? 两个品牌路由器对比分析

《锐捷和腾达哪个好?两个品牌路由器对比分析》在选择路由器时,Tenda和锐捷都是备受关注的品牌,各自有独特的产品特点和市场定位,选择哪个品牌的路由器更合适,实际上取决于你的具体需求和使用场景,我们从... 在选购路由器时,锐捷和腾达都是市场上备受关注的品牌,但它们的定位和特点却有所不同。锐捷更偏向企业级和专

Spring中Bean有关NullPointerException异常的原因分析

《Spring中Bean有关NullPointerException异常的原因分析》在Spring中使用@Autowired注解注入的bean不能在静态上下文中访问,否则会导致NullPointerE... 目录Spring中Bean有关NullPointerException异常的原因问题描述解决方案总结

python中的与时间相关的模块应用场景分析

《python中的与时间相关的模块应用场景分析》本文介绍了Python中与时间相关的几个重要模块:`time`、`datetime`、`calendar`、`timeit`、`pytz`和`dateu... 目录1. time 模块2. datetime 模块3. calendar 模块4. timeit

python-nmap实现python利用nmap进行扫描分析

《python-nmap实现python利用nmap进行扫描分析》Nmap是一个非常用的网络/端口扫描工具,如果想将nmap集成进你的工具里,可以使用python-nmap这个python库,它提供了... 目录前言python-nmap的基本使用PortScanner扫描PortScannerAsync异

Oracle数据库执行计划的查看与分析技巧

《Oracle数据库执行计划的查看与分析技巧》在Oracle数据库中,执行计划能够帮助我们深入了解SQL语句在数据库内部的执行细节,进而优化查询性能、提升系统效率,执行计划是Oracle数据库优化器为... 目录一、什么是执行计划二、查看执行计划的方法(一)使用 EXPLAIN PLAN 命令(二)通过 S

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置