select col1,col2 from A数据结果如下:3.jpgselect col1||'|^|'||col2 from A拼接列之后的结果:2.jpgselect case when col1 is null then '' else col1 end||'|^|'||col2 from A然后我把可能为空的列进行case when处理结果:1.jpg这样问题是解决了,如果有20多列的表,有10列...
显示全部select col1,col2 from A
数据结果如下:
3.jpg
select col1||'|^|'||col2 from A
拼接列之后的结果:
2.jpg
select case when col1 is null then '' else col1 end||'|^|'||col2 from A
然后我把可能为空的列进行case when处理结果:
1.jpg
这样问题是解决了,如果有20多列的表,有10列的值可能包含为空,则要case when 处理10个字段。有没有更好的解决办法呢?
收起