日期:2014-05-18 浏览次数:20569 次
declare @T table (id int,name varchar(4),mny numeric(3,1),rate int,refund int) insert into @T select 1,'大大',15.1,2,3 union all select 2,'了了',12.0,1,4 union all select 3,'小小',9.0,3,1 select id,name, case when mny=(select max(mny) from @T) then '是' else '否' end as mny, case when rate=(select max(rate) from @T) then '是' else '否' end as rate, case when refund=(select max(refund) from @T) then '是' else '否' end as refund from @T /* id name mny rate refund ----------- ---- ---- ---- ------ 1 大大 是 否 否 2 了了 否 否 是 3 小小 否 是 否 */
------解决方案--------------------
http://blog.csdn.net/wufeng4552/article/details/4681510