1
I have two tables in mysql database, GROUPS table and PRODUCTS table.
GROUPS
+-----------------+
| grupoid |
+-----------------+
| 1 |
| 2 |
| 3 |
+-----------------+
PRODUCTS
+-----------------+
| id | grupoid |
+-----------------+
| 1 | 1;2;3 |
+-----------------+
I need to select and separate each group by row as the example below.
Select result
+-----------------+
| produto |grupoid|
+-----------------+
| 1 | 1 |
| 1 | 2 |
| 1 | 3 |
+-----------------+
Thanks in advance for your attention.
search the function
SUBSTRING_INDEX
– Ricardo Pontual