剑轩

sqlserver取日期的一部分

电脑版发表于:2018/10/11 17:21


--年

select DATEPART(year,getdate())

--月

select DATEPART(month,getdate())

--日

select DATEPART(day,getdate())

--时

select DATEPART(Hour,getdate())

--分

select DATEPART(minute,getdate())

--秒

select DATEPART(second,getdate())

--周

select DATEPART(weekday,getdate())


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢