SELECT * FROM (select TOP 99.999999 PERCENT * from [table] where notice=0 order by begintime) a union SELECT * FROM (select TOP 99.999999 PERCENT * from [table] where notice=1 order by begintime desc) b