Scenario:
- A MySQL table
- A Delimiter (e.g. comma) is used to separate entities inside a string store in a column of the MySQL table
- MySQL table contain 2 columns - ID and Countries_Involved
======================================= | ID | Countries_Involved | ======================================= | 1 | Japan, India, France | | 2 | Benin, Chad, Chile, Iraq, Iran | =======================================
How do I use a single SQL statement (very good to have, if possible) to generate a table below:
==================================== | SN | ID | Country | Ordering | ==================================== | 1 | 1 | Japan | 1 | | 2 | 1 | India | 2 | | 3 | 1 | France | 3 | | 4 | 2 | Benin | 1 | | 5 | 2 | Chad | 2 | | 6 | 2 | Chile | 3 | | 7 | 2 | Iraq | 4 | | 8 | 2 | Iran | 5 | ====================================