sql 查询当前日八点的数据,如何写语句

sql 查询当前日八点的数据,如何写语句,第1张

不太理解你的问题。

你说的 八点数据。是什么意思?

是不是要取得下面的结果 ?

select (convert(nvarchar(10),dateadd(dd,0,GETDATE()),120)+ ' ' + '8:00:00')

返回值:2011-06-17 8:00:00

select from witer where time between '2015-12-1' and '2016-01-01' and Datename(minute,time) =0 and Datename(second,time) = 0

取得是整点的数据,你可以用datename()函数自己选取截的时间段

方法一:\x0d\查询上一条记录的SQL语句(如果有其他的查询条件记得加上other_conditions以免出现不必要的错误):\x0d\1\x0d\select from table_a where id = (select id from table_a where id {$id} [and other_conditions] order by id asc limit 1) [and other_conditions];

以上就是关于sql 查询当前日八点的数据,如何写语句全部的内容,包括:sql 查询当前日八点的数据,如何写语句、Sql语句查询、如何获取SQL查询当前数据上一条和下一条的记录等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/9742330.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-01
下一篇 2023-05-01

发表评论

登录后才能评论

评论列表(0条)

保存