日期:2014-05-17  浏览次数:21252 次

求sql语句!
SQL code
b."promotionid1"||'-'||b."promotionless1"||','||b."promotionid2"||'-'||b."promotionless2"||','
||b."promotionid3"||'-'||b."promotionless3"||','||b."promotionid4"||'-'||b."promotionless4"||','||b."promotionid5"||'-'||b."promotionless5"||

把字段组合列,查出的promotionid1...promotionid5这些字段空,
promotionless1...promotionless5怎么把0也该为空,而且把"-和,"也去掉,promotionless为number类型?
-0,-0,-0,-0,-0.

------解决方案--------------------
SQL code
replace(a,'-0',''); a是你的字段!

------解决方案--------------------
探讨
case when promotionid1 is null then '' else promotionid1 end ||
case when promotionless1 is null then '' else '-' || promotionless1 || ',' end ||
...