日期:2014-05-19  浏览次数:20424 次

同一表的两个字段合并成一新字段
回复问题表

其中有两个字段   content,printcontent

id       content                                 printcontent

1         null                                       aaa
2         null                                       bbb
3         [quote]ccc[/quote]           null

null代表空

我想再新建个字段temp

让temp中的值为

aaa
bbb
[quote]ccc[/quote]

------解决方案--------------------
Select *, IsNull(printcontent, content) As temp From 回复问题表
------解决方案--------------------
select id,content,printcontent,temp=isnull(content,printcontent) from 回复问题表
------解决方案--------------------
select temp = (isnull(content, ' ')+ isnull(printcontent, ' ')) from table