0

I would like to split a database row into multiple rows based on a column value in oracle. One of the column holds multiple comma separated clock values. The rows needs to be split into one row for each clock value. for example

The data from the table is like

EmpId WorkDate Clocks Radius
1 9/7/2017 0:00 07:53,07:54,07:56,07:57
2 7/9/2018 0:00 8:00 02295
3 2/9/2018 0:00 9:20 521241
4 1/24/2018 0:00 11:22,11:35 521292,517163

Then it should get split into like below

EmpId WorkDate Clocks Radius
1 9/7/2017 0:00 7:53
1 9/7/2017 0:00 7:54
1 9/7/2017 0:00 7:56
1 9/7/2017 0:00 7:57
2 7/9/2018 0:00 8:00 2295
3 2/9/2018 0:00 9:20 521241
4 1/24/2018 0:00 11:22 521295
4 1/24/2018 0:00 11:35 517163

Does this possible using a query?

subash
  • 69
  • 2
  • 5
  • This article appears to cover functionality that would be useful to this - https://dzone.com/articles/beautiful-sql-lateral-unnesting-of-array-columns – procopypaster Dec 09 '21 at 06:44

0 Answers0