Answers for "mysql-split-and-join-the-values"

SQL
0

mysql-split-and-join-the-values

You can use MySQL FIND_IN_SET() to join the tables and GROUP_CONCAT() to concat the values :

SELECT s.sno,GROUP_CONCAT(s.values) as `values` 
FROM mapping t
INNER JOIN map s ON(FIND_IN_SET(s.id,t.values))
GROUP BY s.sno
Note: You should know that this is a very bad DB structure. 
  This may lead to a lot more complicated queries and will force 
  you to over complicate things. You should Normalize your data, 
split it , and place each ID in a separate record!
Posted by: Guest on April-06-2022

Code answers related to "mysql-split-and-join-the-values"

Code answers related to "SQL"

Browse Popular Code Answers by Language