好好学习,天天向上! avatar

mssql和mssql的时间移动函数SQL函数 | different function in mssql and mysql for time inverval

dailystudy

Published: 03 Feb 2018 › Updated: 03 Feb 2018mssql和mssql的时间移动函数SQL函数 | different function in mssql and mysql for time inverval

mssql和mssql的时间移动函数SQL函数 | different function in mssql and mysql for time inverval

平时都是用mysql多, 无奈steemit上还是mssql数据库更好用,只好开始研究:

平时在mysql下想要移动时间都是需要date_add()函数的。它的用法是

date_add(原时间字段或常量, interval +移动数 类型)

其中类型可以year month day hour minute second


可是在mssql下,这个函数果断不好使了,上网搜了一下,再测试一下,发现原来在mssql下使用的是DATEADD()函数。它的用法是:

DATEADD(类型, 数字, 原时间字段或常量)


伪程序员学习日记——边用边学边记——为了以后便于查询,也为了加强记忆。

欢迎各位偶像前来指正,不胜荣幸&感激!

Leave mssql和mssql的时间移动函数SQL函数 | different function in mssql and mysql for time inverval to:

Written by

伪程序员学习日记! Learning diary of a quasi-programmer

Read more #mssql posts


Best Posts From 好好学习,天天向上!

We have not curated any of dailystudy's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From 好好学习,天天向上!