日期:2014-05-17 浏览次数:20525 次
select * from tb as t
where not exists(select 1 from tb where
convert(varchar(13),ReadDate,120)=convert(varchar(13),ReadDate,120)
and ReadNumber<t.ReadNumber
)
select convert(decimal(18,12),
replace(min(convert(char(13),readdate,120)+convert(varchar(18),ReadNumber)),
min(convert(char(13),readdate,120)),
'')
)
from tab
group by convert(char(13),readdate,120)
select convert(varchar(10),ReadyDate,120) 日期,datepart(hh,ReadyDate) 小时,min(ReadNumber) ReadNumber from [表]
group by convert(varchar(10),ReadyDate,120),datepart(hh,ReadyDate)