I have a data set as below
Table name : Customer_tbl
| Customer_ID | Customer_post |
|---|---|
| 12985 | 201 |
| 20917$@98821$@749021$@357831 | 201$@29$@29$@29 |
| 548357$@276031 | 201$@34 |
| 80315$@75344$@345621 | 201$@29$@14 |
Output I need is as below
| Customer_ID_1 | Customer_ID_2 | Customer_post_1 | Customer_post_2 |
|---|---|---|---|
| 12985 | 201 | ||
| 20917 | 98821$@749021$@357831 | 201 | 29$@29$@29 |
| 548357 | 276031 | 201$@34 | 34 |
| 80315 | 75344$@345621 | 201$@29$@14 | 29$@14 |
I got the Customer_ID_1 & Customer_post_1 as below
SELECT
REGEXP_SUBSTR(Customer_ID,'[^|@]+',1,1) as Customer_ID_1 ,
REGEXP_SUBSTR(Customer_post,'[^|@]+',1,1) as Customer_post_1
FROM Customer_tbl
How to get the Customer_ID_2 and Customer_post_2 columns in the same select statement ?