Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql join on comma separated field

SELECT * FROM `TABLE1`
JOIN `TABLE2` ON `TABLE1`.`id` = `TABLE2`.`COMMA_SEPERATED_COLUMN` 
AND `TABLE2`.`COMMA_SEPERATED_COLUMN` REGEXP "(^|,)SPECIFIC_ID(,|$)"

############## OR #######################

SELECT * FROM table1 
LEFT JOIN table2 ast ON ast.nodeid = c_NodeId 
AND ',' + ast.GroupNames + ',' LIKE '%,' + table1.GroupAlphabet + ',%';
Comment

PREVIOUS NEXT
Code Example
Sql :: fk in insert mysql 
Sql :: mysql search replace 
Sql :: sqlalchemy get ids 
Sql :: unique element in sql 
Sql :: mysql nested query 
Sql :: mysql dump 
Sql :: docker hub mysql 
Sql :: sql get month 
Sql :: sql limit order by 
Sql :: min mysql 
Sql :: select only distinct values another table 
Sql :: what data type to use for phone number in sql 
Sql :: having clause 
Sql :: sql update multiple tables 
Sql :: oracle step procedure 
Sql :: get specific column in mongodb 
Sql :: sql foreign key constraint 
Sql :: copy data from one postgres container to another 
Sql :: trunc sysdate in oracle 
Sql :: alter in sql 
Sql :: selecting specific day in colum sql 
Sql :: SELECT ALL TABLE INFO 
Sql :: Inser Dataframe into mysql 
Sql :: sql max value in column 
Sql :: how to insert same table data using mysql query 
Sql :: what is subquery in sql 
Sql :: attributes of cursor in sql 
Sql :: T-SQL and the WHERE LIKE %Parameter% clause 
Sql :: Kill session in SQL Developer 
Sql :: end mysql command 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =