i have an oracle database with a column entry as the following:
{"Name":"Robert","information":"[200A1F0D00","Changed position from Dep1 to Dep2. Changed location from NewYork to Paris. Salary group switch from low to high."]}
The following result i want to generate with SQL:
| ID | Dep_old | Dep_new | Loc_old | Loc_new | salary_old | salary_new |
|---|---|---|---|---|---|---|
| 200A1F0D00 | Dep1 | Dep2 | New York | Paris | low | high |
How can I do this? I tried to use regex_substring functions, but it didn´t work out. For now: this is my progress:
select REGEXP_SUBSTR(f.EMPLOYEE, '[^,]+', 1, 2) AS a,
REGEXP_SUBSTR(f.EMPLOYEE, '[^,]+', 1, 3) AS b,
from Staff.EMPLOYEE f;
Can you please help me and create the query? Best regards dontknowguy