problem in running complex multiple table mysql query
i need to sh开发者_运维问答ow pages'details , now i used this query to fetch from 3 tables
group_concat( )
its working fine but shows array of tags and topics duplicated.
You're getting extra rows from the join. Add DISTINCT to the GROUP_CONCAT construct:
SELECT table_stories.*,
table_stories.sid,table_tags.tid,table_topics.topicid,
group_concat(DISTINCT table_tags.tag ) as mytags,
group_concat(DISTINCT table_topics.topicname ) as mytopics
FROM table_stories,table_tags,table_topics
精彩评论