I use the ‘sql console’ in phpMyAdmin to try out some queries. The following query is working like a charm:
Select * from firstTable T1, secondTable T2 Where T2.name = T1.name
What I now would like is to have a similar query using the LIKE statement. Unfortunately it is not working. Here below what I tried. Thks in advance. Cheers. Marc.
Select * from firstTableb T1, secondTable T2 Where T2.name LIKE "%T1.name%"
In your example, you are comparing
t2.nameto the string%T1.name%, meaning it literally needs to contain the textT1.name. To search for the actual contents, you need to concatenate in the value: