日期:2014-05-17 浏览次数:20754 次
WITH t AS( SELECT '100w1'no,1 state FROM dual UNION ALL SELECT '100w2',3 FROM dual UNION ALL SELECT '101w1',2 FROM dual UNION ALL SELECT '101w2',6 FROM dual ) SELECT SUBSTR(No,1,LENGTH(No)-1)no,wm_concat(state)state FROM t GROUP BY SUBSTR(No,1,LENGTH(No)-1)
------解决方案--------------------
wm_concat()函数即可 根据条件连接字符 以逗号分割开
------解决方案--------------------
使用wm_concat这个函数就可以了