2、GROUP_CONCAT()函數函數
group_concat([DISTINCT] 要鏈接的字段 [Order BY ASC/DESC 排序字段] [Separator '分隔符'])排序
GROUP_CONCAT函數返回一個字符串結果,該結果由分組中的值鏈接組合而成。
使用表info做爲示例,其中語句SELECT locus,id,journal FROM info WHERE locus IN('AB086827','AF040764');的返回結果爲
+----------+----+--------------------------+
| locus | id | journal |
+----------+----+--------------------------+
| AB086827 | 1 | Unpublished |
| AB086827 | 2 | Submitted (20-JUN-2002) |
| AF040764 | 23 | Unpublished |
| AF040764 | 24 | Submitted (31-DEC-1997) |
+----------+----+--------------------------+字符串