读书人

同一表的两个字段合并成一新字段(new)

发布时间: 2012-03-01 10:25:46 作者: rapoo

同一表的两个字段合并成一新字段(new)
想了想,我刚才问的不太对- -,重新再问下...

回复问题表

其中有两个字段 content,printcontent

id content printcontent

1 ' ' aaa
2 ' ' bbb
3 [quote]ccc[/quote] <table width=100%...下面引用由... <br>

content的值是 ' ',不是null

我想再新建个字段temp

让temp中的值为

aaa
bbb
[quote]ccc[/quote]

[解决办法]
select temp = (case when isnull(content, ' ') = ' ' then printcontent else content end)
from 回复问题表

读书人网 >SQL Server

热点推荐