例如:select ID, DuctID,TmpCode ,TaskNO, CrtDate,WorkName,DATEDIFF(MI,CrtDate, getdate()) as minuts from V_tabCrtCodeSub where Iflag=1 and IState=1 and DATEDIFF(MI,CrtDate, getdate())>(select TimLen from tabtimctrl where ID = 2) and TmpCode in(Select TmpCode from tabCrtCode where IntVal3=1 and Iused=0)
and TmpCode NOT in(Select TmpCode from TabBarCodeState WHERE Iflag=1)
其中 DATEDIFF(MI,CrtDate, getdate()) as minuts from V_tabCrtCodeSub 中的 DATEDIFF是用时间比较
有关于Sql中in的用法
最新推荐文章于 2023-10-10 19:20:15 发布