拆字符串成多记录

【问题】

I use Version: Luna Service Release 1 (4.4.1)

Build id: 20140925-1800

Could you tell me how, for each line, how to cut the line in terms of space and put each value on another line

My table:
ID ANOMALIES
3903 B1 D1 CAT1
3904 D7 D2 B1 CAD4

I would like to:
ID ANOMALIES
3903 B1
3903 D1
3903 CAT1
3904 D7
3904 B1
3904 D2
3904 CAD4

I am Beginner and I have a lot of difficulties with the declaration and use array, I don’t understand when and how filling an array
Could you help me?

Thank You, have a nice day
Pierre

【回答】

用存储过程可以将字段拆分为多条记录,但代码复杂不易编写,这种情况可以用 SPL 实现,脚本如下:

A
1$select * from data
2=A1.news(ANOMALIES.split(" ");ID:ID,~:ANOMALIES)

A1:读取 data 表

1png

A2:将 ANOMALIES 字段值用空格拆分成序列,合并生成新的序表

2png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值