我有一张 table
id、数字、语言、短语
每个数字都有多个条目,例如
1, 01, de, Hallo
2, 01, en, Hello
3, 01, fr, Salut,
4, 02, de, Guten Tag
5, 02, en, Good Day
..
语言数量是固定的
如何创建数据排列如下的 View
id, de, en, fr
1, Hallo, Hello, Salut
2, Guten Tag, Good Day, ''
最佳答案
select number,
max(case when lang = 'de' then phrase end) as de,
max(case when lang = 'en' then phrase end) as en,
max(case when lang = 'fr' then phrase end) as fr
from your_table
group by number
关于mysql 从表创建 View 并排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28025365/