xiaoid的博客-- 查询表记录,从起始时间到结束时间,间隔5分钟取一条记录。 SELECT [Time] FROM ( Select ROW_NUMBER()OVER(PARTITION BY DATEDIFF(mi,'2019-3-15 9:0:0',[Time])/时间间隔 ORDER BY 表1.[Time]) AS 新的列名称...
yicai168的博客查询历史记录时要求每间隔10分钟取一个样点,查过去10小时的数据SQL语句: declare @endDate datetime declare @startDate datetime set @endDate=(select max([monitorTime]) from table_x where columnA='...
菜菜菜菜菜鸡的博客select a.* from table a where collectionTime between cast('2019-10-03 00:00:00' as datetime) and cast('2020-03-13 13:55:00' as datetime) and datediff(minute,'2019-10-03 00:00:00',a.collectionTi...