日期:2014-05-18 浏览次数:20696 次
select isnull(isnull(a.name,b,name),c.name) as name ,a.学号 from a left join b on a.学号 = b.学号 left join c on a.学号 = c.学号
------解决方案--------------------
select COALESCE(a.Name,b.Name,c.Name) as Name COALESCE(a.学号,b.学号,c.学号) as 学号 from a full join b on a.Name=b.Name full join c on c.Name=a.Name
------解决方案--------------------
case when
------解决方案--------------------
select case when a.name is not null then a.name else case when b.name is not null then b.name else c.name end end from tb
------解决方案--------------------
select name=COALESCE(a.Name,b.Name,c.Name),a.学号 from a left join b on a.学号 = b.学号 left join c on a.学号 = c.学号