`
kobe6111
  • 浏览: 8461 次
  • 性别: Icon_minigender_1
  • 来自: 山西
社区版块
存档分类
最新评论

sql中根据出生日期精确到日的计算语句

SQL 
阅读更多

print datediff(year,'1988-1-18',getdate())-case
when
datediff(day,getdate(),dateadd(year,datediff(year,'1988-1-18',getdate()),'1988-1-18'))>=0 then 1 else 0
end


将语句中的常量替换成 你表的出生年月的 列

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics