Suliman alkous
Sunday, December 11, 2011
Compare two columns using like syntax In MYSQL
if you have two tables:
emp (id , name, grad)
grad (id, name)
and you want to compare column (emp.name and grad.name) with LIKE % use this:
select e.name, g.name
from emp e inner join grad g
ON e.grad like CONCAT('%',g.name, '%');
Newer Post
Older Post
Home