日期:2014-05-18 浏览次数:20469 次
create table ndd987 ( id1 varchar(10), id2 varchar(10), id3 varchar(10), id101 varchar(10), id102 varchar(10) ) insert into ndd987 select 'aa','bb','cc','dd','ee' union all select 'aa','','cc','dd','ee'union all select 'aa','bb','','dd','ee'union all select 'aa','bb','cc','dd',''union all select 'aa','bb','cc','dd','ee' select * from ndd987 select case when id1 = '' then '987' else id1 end+ case when id2 = '' then '987' else id2 end+ case when id3 = '' then '987' else id3 end as 数据, id101,id102 from ndd987 ============================= 数据 字段101 字段102 aabbcc dd ee aa987cc dd ee aabb987 dd ee aabbcc dd aabbcc dd ee