SQL2008数据段问题
时间:2011-12-27
来源:互联网
我下面给出一小段代码,请各位大侠帮忙修改下实现以上的要求,谢谢指教……
create proc historydata
@stationid tinyint,
@starttime datetime,
@overtime datetime
as
begin
select Temperature,AirPressure,Humidity,WindDirection,WindSpeed,RainFall,WeatherPhenomenonName,StartTime,OverTime
from SixFactors
join WeatherPhenomenon on WeatherPhenomenon.WeatherNO = SixFactors.WeatherNO
where SixFactors.StationID = @stationid and DATEDIFF(SixFactors.CollectDate,@starttime,@overtime)
go
作者: Yp2800 发布时间: 2011-12-27
作者: WWWWA 发布时间: 2011-12-27
select * from tb where rowtime< dateadd(timeclumn,h,-1);
select * from tb where rowtime< dateadd(timeclumn,h,-6);
select * from tb where rowtime< dateadd(timeclumn,h,-24);
select * from tb where rowtime between '2011-12-26 00:00:00' and ''2011-12-27 00:00:00'
作者: rucypli 发布时间: 2011-12-27
作者: TravyLee 发布时间: 2011-12-27
1,6,24小时记录的数据该怎么写? 什么意思 是同事查看还是逐个查看 最好弄个查询后的样式看看
作者: ju523756055 发布时间: 2011-12-27
作者: Yp2800 发布时间: 2011-12-27
1,6,24小时记录的数据该怎么写,还有任意两个时间点datetime间的数据又该如何写
select * from tb where rowtime< dateadd(timeclumn,h,-1);
select * from tb where rowtime< dateadd(timeclumn,h,-6);
select * from tb where rowtime< da……
rowtime是什么呀?
作者: Yp2800 发布时间: 2011-12-27
create proc historydata @stationid tinyint, @starttime datetime, @overtime datetime as begin select Temperature,AirPressure,Humidity,WindDirection,WindSpeed,RainFall,WeatherPhenomenonName,StartTime,OverTime from SixFactors join WeatherPhenomenon on WeatherPhenomenon.WeatherNO = SixFactors.WeatherNO where SixFactors.StationID = @stationid and SixFactors.CollectDate BETWEEN @starttime AND @overtime go
作者: kuqideyupian 发布时间: 2011-12-27
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28