我正在使用此处接受的答案中描述的“毒物”解决方案用于标记系统。我想搜索带有“Apple”标签的任何问题。我还需要返回该问题的所有其他标签,但我的查询只返回“Apple”标签:
SELECT b.id, allTags.* , GROUP_CONCAT( t.name order by t.name SEPARATOR ',') AS allTags
FROM tagmap bt, bookmark b, tag t
WHERE bt.tag_id = t.tag_id
AND (t.name = 'Apple')
AND b.id = bt.bookmark_id
GROUP BY b.id
给我:
...,'...','...','...','2013-10-07','Apple' # only the matching tag...I need all the others
我如何获得以下内容?:
...,'...','...','...','2013-10-07','Apple,Tim Cook,iPhone,iPad' # the rest of the tags for this question