I've performance problems with this query:
SELECT *
FROM post
JOIN post_plus
ON post_plus.news_id = post.id
WHERE category in(130,3)
AND approve=1
AND allow_main=1
ORDER BY kp_votes DESC,
kp_rating DESC LIMIT 30;
What I'd like to try is convert the above query to a "subquery" instead of using JOIN
What I've tried:
SELECT *
FROM post
WHERE category in(130,3)
(SELECT *
FROM post_plus
WHERE post_plus.news_id = post.id)
AND approve=1
AND allow_main=1
ORDER BY fixed DESC,
kp_votes DESC,
kp_rating DESC LIMIT 10;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select kp_votes kp_rating from post_plus WHERE post_plus.news_id = ' at line 1