| 发表于:2007-03-27 18:50:095楼 得分:0 |
declare @t table(city char(4),date tinyint,c int) insert @t select '武汉 ', 1 , 30 union all select '上海 ' ,1 , 32 union all select '南京 ' ,1 , 31 union all select '北京 ' ,1 , 29 union all select '上海 ' ,2 , 29 union all select '南京 ' ,2 , 38 union all select '北京 ' ,2 , 31 union all select '南京 ' ,3 , 30 union all select '北京 ' ,3 , 31 select * from @t as a where not exists(select 1 from @t as b where a.city = b.city and a.date < b.date) | | |
|