Table 1
id(int) | name(varchar) 1 | at,bat 2 | cat,at,bat,mat 3 | mat,cat 4 | sat,bat
table 2
id(int) | type(varchar) 1 | at 2 | mat
As you can see, table1 contains the csv rows. Now I need to get the id from Table 1 , whose name exists in the field of type Table2 .
Is there any clean way to query mysql? if not, what would be the most efficient way to do this in the case of large recordsets?
source share