I have the following two tables. I want to join them in a single query.I am able to do it with inner join if the Blog_Category_Id in Blog table is a single value. But when it comes as a multiple value how can i do it?
Below is the result table which i want to show...
SELECT b.* ,GROUP_CONCAT(bc.blog_category ORDER BY bc.id) blog_category
FROM blog b
INNER JOIN blog_category bc ON FIND_IN_SET(bc.id, b.blog_category_id)
GROUP BY b.id
You can you FIND_IN_SET
in INNER JOIN
Check here You may got answer
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.