日期:2014-05-17  浏览次数:20414 次

获取大于今天的 3天的数据
日期可能不连续  需要获取3天,这sql语句的条件要怎么写

------解决方案--------------------
select * from 表 where 日期 in 
(
SELECT TOP 3 *
FROM
(
SELECT DISTINCT 日期 FROM 表 WHERE 日期 > 今天
) a
)
------解决方案--------------------
select * from tableName 
where date in
(
   select top 3 * from
   (
    select distinct date from table where date > today
   )
)