当前位置:网站首页>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点。
边栏推荐
猜你喜欢

RESOURCE_EXHAUSTED: etcdserver: mvcc: database space exceeded

Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning

牛客刷题——剑指offer(第四期)

万字总结:分布式系统的38个知识点

OpenCV图像处理学习三,Mat对象构造函数与常用方法

首次在我们的centos登录我们的Mysql

【web渗透】SSRF漏洞超详细讲解

Not, even the volume of the king to write code in the company are copying and pasting it reasonable?

2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
![[论文阅读] Diverse Image-to-Image Translation via Disentangled Representations](/img/b8/891b8a8e7e70a1abd2016337ebc744.jpg)
[论文阅读] Diverse Image-to-Image Translation via Disentangled Representations
随机推荐
Linux(Centos7)服务器中配置Mysql主从数据库,以及数据库的安装,防火墙操作
Process management and task management
Janus actual production case
Visual low-code system practice based on design draft identification
unity编辑器扩展界面使用 List
【每日一题】1413. 逐步求和得到正数的最小值
【机器学习】随机森林、AdaBoost、GBDT、XGBoost从零开始理解
22.括号生成
OpenCV图像处理学习二,图像掩膜处理
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
sql实战积累
首次在我们的centos登录我们的Mysql
OpenCV图像处理学习四,像素的读写操作和图像反差函数操作
C# 四舍五入 MidpointRounding.AwayFromZero
【wpf】拖拽的简单实现
基于设计稿识别的可视化低代码系统实践
翻译软件免费版下载-免费版翻译软件下载
Shader Graph learns various special effects cases
如何让数据库中的数据同步
C# 单例模式