SELECT posts.post_id, posts.post_title, 
GROUP_CONCAT(categories.category_name) AS categories_name, 
GROUP_CONCAT(categories.category_id) AS categories_id, 
GROUP_CONCAT(tags.tag_id) AS tags_id, GROUP_CONCAT(tags.tag_name) AS 
tags_name FROM posts INNER JOIN posts_categories ON 
posts_categories.post_id=posts.post_id INNER JOIN categories ON 
posts_categories.category_id=categories.category_id INNER JOIN posts_tags ON 
posts_tags.post_id=posts.post_id INNER JOIN tags ON 
posts_tags.tag_id=tags.tag_id;

This doesn't work if I have 0 tag for a post or 0 categor for a post.
Also it display only 1 row with all categories ( I have removed tags part to 
make the example ).

I'm not saying that you are wrong because I've to learn the differences 
between them, I'm only exposing results :)

Thank you for your advice, I will take a look at it.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to