当前位置:网站首页>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
- In the 2022 gold, nine, silver and ten work tide, how can I successfully change jobs and get a high salary?
- [转] Typora_Markdown_图片标题(题注)
- hopscotch game
- 用于X射线光学器件的哈特曼波前传感器
- Summary of Web Performance Testing Models
- UXDB现在支持函数索引吗?
- 《GB39732-2020》PDF download
- Maya制作赛博朋克机器人模型
- C# rounding MidpointRounding.AwayFromZero
猜你喜欢

对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告

OpenSSF的开源软件风险评估工具:Scorecards

彩色袜子题

20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法

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

Shader Graph learns various special effects cases

跳房子游戏

Unity3D创建道路插件EasyRoads的使用

具有多孔光纤的偏振分束器

Unity image is blurry after using long image
随机推荐
unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla
基于设计稿识别的可视化低代码系统实践
微透镜阵列后光传播的研究
具有多孔光纤的偏振分束器
STM32F103驱动HCSR04超声波测距显示
牛客刷题——剑指offer(第四期)
Shader Graph learns various special effects cases
【Grpc】简介
【Grpc】报错:status = StatusCode.UNIMPLEMENTED details = ““
浏览器中location详解
FILE结构体在stdio.h头文件源码里的详细代码
信息化和数字化的核心差异
基于FTP协议实现文件上传与下载
常用正则备查
C# rounding MidpointRounding.AwayFromZero
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
防勒索病毒现状分析
Process management and task management
The shell specifies the parameter name to pass the parameter
Not, even the volume of the king to write code in the company are copying and pasting it reasonable?