select distinct (select min([time]) from times where substring(convert(varchar(20),[time],121),0,11)=substring(convert(varchar(20),getdate(),121),0,11) and substring(convert(varchar(20),[time],121),12,8)'18:30:00')from times 已经试过,可以使用 time为时间列名,times为表名 这里面加了判断,只对当天日期有效,如果需要定点查某一天,把getdate()换成需要查询的当天日期就好
|