I'm trying to do a query in mysql
SELECT *
FROM table_name1
WHERE codregister IN
(SELECT register
FROM tablename2
WHERE city LIKE '%paris%')
ORDER BY date DESC
In table_name "codregister" is a primary key but in tablename2 "register" field column is a index (primary key on tablename2 is an autoincrement).
In the table_name1 doesn´t have matches with the tablename2 but the execution time of the query is to slow. Someone can recommend to improve the query?
INNER JOINor something to the effect).