开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜