当前位置:网站首页>SQLserver adds a judgment
SQLserver adds a judgment
2022-08-10 02:52:00 【CSDN q&a】
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 BYlp.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'
Add a judgment to help. Before 9 o'clock every day, check yesterday's 8:00 to yesterday's 20:00, and after 9:00, check today's 8:00 to today's 20:00.
边栏推荐
猜你喜欢

Process management and task management

Button countdown reminder

OpenCV图像处理学习四,像素的读写操作和图像反差函数操作

多线程之自定义线程池

Sikuli's Automated Testing Technology Based on Pattern Recognition

2022杭电多校联赛第七场 题解

程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果

T5:Text-toText Transfer Transformer

C# 四舍五入 MidpointRounding.AwayFromZero

odoo公用变量或数组的使用
随机推荐
【内存管理概述 Objective-C语言】
FILE结构体在stdio.h头文件源码里的详细代码
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
Under pressure, there must be cowards
翻译软件免费版下载-免费版翻译软件下载
OpenCV图像处理学习四,像素的读写操作和图像反差函数操作
[论文阅读] Diverse Image-to-Image Translation via Disentangled Representations
SQLserver加个判断
程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果
RESOURCE_EXHAUSTED: etcdserver: mvcc: database space exceeded
已备案域名用国外服务器会不会掉备案?
Unity碰撞和触发
FusionCompute产品介绍
Unity image is blurry after using long image
数据库治理利器:动态读写分离
Shell编程--awk
Sikuli's Automated Testing Technology Based on Pattern Recognition
[Turn] Typora_Markdown_ picture title (caption)
Solve the problem of sed replacement text containing special characters such as "/" and "#"
《GB39732-2020》PDF download