I have a table like:
+----+--------+----------------+
| id | name | address |
+----+--------+----------------+
| 1 | Ivan | Moscow,Moscow |
| 2 | Petr | Samara,Samara |
| 3 | Grigor | Moscow,Korolev |
+----+--------+----------------+
How can I create a new table (or view) from this table, so that if the 'address' column contains the different values on the sides of the separator, insert two rows into the new table with all other data using Oracle PL/SQL? For this example the result should be:
+----+--------+---------+
| id | name | address |
+----+--------+---------+
| 1 | Ivan | Moscow |
| 2 | Petr | Samara |
| 3 | Grigor | Moscow |
| 3 | Grigor | Korolev |
+----+--------+---------+