One Row to Multiple Rows - Case 1
【Question】
SalesCode TeamBelow
CD0001 a,b,c
CD0002 h,i,j
To:
SalesCode TeamBelow
CD0001 a
CD0001 b
CD0001 c
CD0002 h
CD0002 i
CD0002 j
【Answer】
For the time being, database products can’t handle this type of computing task without lengthy and roundabout code. So I choose to do it in SPL (Structure Process Language):
A |
|
1 |
$SELECT SalesCode, TeamBelow FROM TB |
2 |
=A1.news(TeamBelow.split@c();SalesCode,~:TeamBelow) |
esPrc provides JDBC interface to function like a database. To learn more, you can refer to How to Call an SPL Script in Java.
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_SPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL