如何在MYSQL中对具有相同类型id的不同行数据进行分组?

How to group the different row data with same type id in MYSQL?

table是这样的

blog
----
id
type
lang
title
content

所以示例数据是

id  type lang title content
1    1    1    abc    edf
2    1    2    abcxz    edf
3    2    1    asdc    df
4    2    2    ggf    edsdff
5    2    3    ssdf    sdf

lang 是博客语言,例如1 个英语,2 个法语,3 个德语

所以我不想显示所有行,而是想按类型分组

例如

结果应该只有 2 行

for type 1
title_en, title_fr, ..

and for type 2
title_en, title_fr, title_de ..

感谢您的帮助。

GROUP_CONCAT() 应该有帮助:

SELECT lang,
       Group_concat(Concat(lang, ':', title))
FROM   blog_titles
GROUP  BY lang