我正在使用这个MySQL查询。它需要6.3秒或更长的时间。
SELECT * FROM `wp_wpds_tlds` WHERE 1 AND `id` IN (SELECT p.`tld_id` id FROM `wp_wpds_category_pivot` p, `wp_wpds_categories` c WHERE c.id=p.category_id AND `category` LIKE '%City%') ORDER BY `tld` ASC
答案 0 :(得分:-2)
您必须在WHERE后删除 1 AND :
SELECT * FROM wp_wpds_tlds
WHERE id IN (SELECT p.
tld_id id FROM
wp_wpds_category_pivot p,
wp_wpds_categories c WHERE c.id=p.category_id AND
category LIKE '%City%') ORDER BY
tld` ASC