Hi im having difficulties in splitting multiple column values into multiple rows, i have already done this code in oracle so here is the source table and desired output
SOURCE:
DEAL_ID | GROUP_ID
1 | 12 13 14
2 | 15 16
3 | 17
OUTPUT:
DEAL_ID | GROUP_ID
1 | 12
1 | 13
1 | 14
2 | 15
2 | 16
3 | 17
I have already did this in oracle sql, the code goes like this.
CREATE table mydb.DEAL_GROUPING
SELECT DISTINCT
DEAL_ID,
regexp_substr(GROUP_ID,'[^" "]+', 1, level) as GROUP_ID_NEW
FROM DEAL_UPLOAD
CONNECT BY regexp_substr(GROUP_ID, '[^" "]+', 1, level) is not null
the problem here is, this regexp_substr function does not exist/valid in MySQL. can any body help me translate this function from oracle to mysql?
Thnks,
Nasman