我对mysql查询没有什么问题。我需要 GROUP_CONCAT 中的 GROUP_CONCAT 之类的东西。看:
数据库设计:
SELECT cid, country, capital,
GROUP_CONCAT(DISTINCT mid, '=',city SEPARATOR '|*|') AS data
FROM t1
INNER JOIN t2 ON t2.c_id = t1.cid
INNER JOIN t3 ON t2.c_id = t3.mid
WHERE t1.cid =1
返回
[cid] => 1
[country] => France
[capital] => Paris
[data] => 1=Lyon|*|2=Chartres|*|3=Valence
但我想加入这个查询表 t4(我不知道怎么做),如果输出看起来像这样就好了
[cid] => 1
[country] => France
[capital] => Paris
[data] => 1=Lyon=|*|2=Chartres=Max#Alex#Frank|*|3=Valence=John
附言。t4.m_id = t3.mid