0

我有桌子

MsgID    Msg              value
ms001    I am here.       ----
ms001    Wher are you     dsdad
ms002    who r u          gfsdfdf
ms002    where is this    dadad
ms002    I am goin        adadad

这有可能通过 MySQL 查询得到这样的结果吗

ms001    I am here. Wher are you
ms002    who r u wher is this I am goin  
4

1 回答 1

6

阅读关于 group_concat

SELECT MsgID , GROUP_CONCAT(Msg SEPARATOR ' ') AS Msg
FROM table1
GROUP BY MsgID;

SQL小提琴

于 2013-08-01T04:41:19.767 回答