Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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!
Comment

PREVIOUS NEXT
Code Example
Sql :: sqlites studio red exclamation mark when poening databse 
Sql :: from _sqlite3 import * ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden. 
Sql :: install phpmyadmin pma 
Sql :: crear usuario oracle 
Sql :: acutal month year 
Sql :: java mysql swing example 
Sql :: create sql database 
Sql :: mysql master slave setup with keepalived 
Sql :: which lock mode is not available in sql 
Sql :: oracle sql how to overcome 999 limit for IN 
Sql :: linked server delete openquery 
Sql :: sql requete number pair 
Sql :: oracle transaction rollback not working 
Sql :: mybatis batch update oracle 
Sql :: select even number id data from table 
Sql :: Aktor yang pernah terlibat di film bergenre Aksi di sql 
Sql :: mysqldump error --no-beep 
Sql :: how to user id to show in from date to upto date in mssql server 
Sql :: sql server in linux 
Sql :: subquery in select 
Sql :: create table database in psql 
Sql :: insert into table with only identity column 
Sql :: Insert results of a stored procedure into a temporary table 
Sql :: retornar apenas o ano mysql date 
Csharp :: messagebox yes-no 
Csharp :: how to make c# open brower 
Csharp :: how to check the tag of a collider in unity 
Csharp :: c# exit console 
Csharp :: unity play particle system 
Csharp :: how to set a custom size for window in monogame 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =