zoukankan      html  css  js  c++  java
  • 数据库备忘

    返回自增ID

    Select @@Identity

    去重

    distinct

    时间差

    DateDiff(s,'2005-07-20','2005-7-25 22:56:32')返回值为 514592 秒 
    DateDiff(d,'2005-07-20','2005-7-25 22:56:32')返回值为 5 天 

    返回周

    select DatePart(w,'2005-7-25 22:56:32')

    返回年份

    select  DatePart(yyyy,'2005-7-25 22:56:32')

    当前日期是几号

    select DatePart(d,'2005-7-25 22:56:32')

    取得当着日期在本年中的第几天

    select DatePart(y,getdate())

    select * from crm_contact where companyId=1 and isDelete=0 and((DatePart(y,C_birthday)-DatePart(y,getdate()))between 0 and 7)

  • 相关阅读:
    USB
    Google
    机型参数
    mac
    反编译
    xcode
    Ios 消息推送
    真机:特殊
    Android
    object-c
  • 原文地址:https://www.cnblogs.com/Celebrator/p/4446777.html
Copyright © 2011-2022 走看看