赞
踩
例如数据长这个样子
id | name | value |
1 | 张三 | 1,2,3 |
2 | 李四 | 4,5,6,7 |
想要这个样子
id | name | value |
1 | 张三 | 1 |
1 | 张三 | 2 |
1 | 张三 | 3 |
2 | 李四 | 4 |
2 | 李四 | 5 |
2 | 李四 | 6 |
2 | 李四 | 7 |
实现:
select
TRANS_ARRAY(2,',',id,name,value) as (new_id,new_name,new_value)
from table
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。