当前位置:网站首页>SQLserver加个判断
SQLserver加个判断
2022-08-10 01:39:00 【CSDN问答】
SELECT count(distinct lp.lot_number)as ELzs
FROM (SELECT lp.lot_number,lp.TransDate,lp.WorkorderId ,lp.device_number,
ROW_NUMBER() OVER( PARTITION BY lp.lot_number ORDER BY lp.TransDate)RN FROM Lot_Process lp)lp
WHERE RN=2 and (lp.WorkorderId like'PB%' or lp.WorkorderId like'DB%') and
lp.device_number in('M1-EL1-L1-01','M1-EL1-L1-02')
and lp.TransDate between convert(varchar(11),dateadd(day,-1,getdate()),120)+'08:00:00'
and convert(varchar(11),dateadd(day,-1,getdate()),120)+'19:59:59'
给帮忙加个判断,每天9点之前查询昨天8点到昨天20点,9点之后查询今天8点到今天20点。
边栏推荐
猜你喜欢
随机推荐
[LeetCode] Find the sum of the numbers from the root node to the leaf node
Initial attempt at UI traversal
LeetCode 每日一题——1413. 逐步求和得到正数的最小值
Premint工具,作为普通人我们需要了解哪些内容?
翻译工具-翻译工具下载批量自动一键翻译免费
【内存管理概述 Objective-C语言】
Teach you how to write performance test cases
中级xss绕过【xss Game】
OpenCV图像处理学习一,加载显示修改保存图像相关函数
[论文阅读] Diverse Image-to-Image Translation via Disentangled Representations
组件的使用
The shell specifies the parameter name to pass the parameter
OpenSSF的开源软件风险评估工具:Scorecards
Unity碰撞和触发
已备案域名用国外服务器会不会掉备案?
高并发+海量数据下如何实现系统解耦?【下】
【机器学习】随机森林、AdaBoost、GBDT、XGBoost从零开始理解
通关剑指 Offer——剑指 Offer II 012. 左右两边子数组的和相等
egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
shell指定参数名传参