Sql statement to achieve data perspective?

+------------------------+-------------------------------------------+
| book                   | name                                      |
+------------------------+-------------------------------------------+
| C-sharp             | ,,                            |
| java       | ,,,,,             |
+------------------------+-------------------------------------------+

this is a data table from which the output style of the extracted data is as follows:

+--------+------------------------+
| name   | book                   |
+--------+------------------------+
|    | java       |
|    | java       |
|    | C-sharp             |
|    | java       |
|    | java       |
|    | java       |
|    | C-sharp             |
|    | java       |
|    | C-sharp             |
+--------+------------------------+

how is it implemented?

Sql
Oct.16,2021
For
select a.book as 'book',substring_index(substring_index(a.name,',',b.help_topic_id+1),',',-1) as 'name'
from users a
join  mysql.help_topic b on b.help_topic_id < (length(a.name) - length(replace(a.name,',',''))+1);

postgres, use unnest

Menu