The LIKE operator works with strings (CHAR, NVARCHAR, etc). so you need to concattenate the ‘%’ symbol to the string…
MS SQL Server:
SELECT * FROM table1,table2 WHERE table1.x LIKE table2.y + '%'
Use of LIKE, however, is often slower than other operations. It’s useful, powerful, flexible, but has performance considerations. I’ll leave those for another topic though 🙂
I don’t use MySQL, but this may work…
SELECT * FROM table1,table2 WHERE table1.x LIKE CONCAT(table2.y, '%')