I have two tables, table1 and table2. I need to search occurrence of table1.col1 in col1.table2. How can I achieve this ?
I did the following statement, but I'm not experienced in mySQL. I'm not sure if this the right method to query from two different unrelated tables? col1 and col2 are strings.
select table1.col1, table2.col1 from table1, table2 where
STRCMP(table1.col1, table2.col1)=0;
Is this correct statement for my purpose? Can it be optimized ?