数据库中有1字段出生年月,怎么样把某一段(比如2006-1-1到2006-12-30)排在前面

解决方案 »

  1.   

    select * from [Table] order by case when [Date] between '2006-1-1' and '2006-12-30' then 0 else 1 end,[Date]
      

  2.   

    select * from 表 where 字段 between '2006-1-1' and '2006-12-30'
    union all
    select * from 表 where 字段< '2006-1-1' and 字段> '2006-12-30'
      

  3.   

    select * from 表 where 字段 between '2006-1-1' and '2006-12-30'
    union all
    select * from 表 where 字段 not between '2006-1-1' and '2006-12-30'