This is the query that I have written to fetch all reviews of Author-1. Author-1 has written 2 posts each having many reviews. I want all those reviews.
SELECT *
FROM `package_reviews`
WHERE `post_id` = (SELECT `post_id`
FROM `wp_posts`
WHERE `post_author`=1);
Getting the error message as #1242 - Subquery returns more than 1 row.
You should use join here.
Something like this.
SELECT * FROM `package_reviews` r LEFT JOIN `wp_posts` p ON r.post_id= p.post_id WHERE p.post_author = 1