zoukankan      html  css  js  c++  java
  • sql between and 复制表

    1 -between and 包括边界值,如果是日期 截止日期到00点0分 如果截止日期:2019-7-26 则为:2019-7-26 00:00:00

    not between and 不包括边界值

    2 复制表

    select * into newtable from oldtable where 1=2

    insert into newtable select * from oldtable

    3 取库龄

    Select PartInnerCode,StorageInnerCode,RemainAmount as InAmount,RM ,InOutDate,p.PartName,s.StorageName,
    DateDiff(Day,InOutDate,GetDate())
    From tbStorageDetail d inner join tbInfoPart p on d.PartInnerCode=p.InnerCode
    inner join tbInfoStorage s on d.StorageInnerCode=s.InnerCode
    Where (RemainAmount>0) and DateDiff(Day,InOutDate,GetDate())>=4-- Between 2 And 3
    and PartName ='测试商品1'

  • 相关阅读:
    Win10中的IIS10安装php manager和IIS URL Rewrite
    第十四周
    第十三周
    第十二周
    第十一周
    第十周
    第九周
    测试作业
    第八周
    第七周
  • 原文地址:https://www.cnblogs.com/caojuansh/p/11249230.html
Copyright © 2011-2022 走看看