-4
我有以下表重复的记录
ID DEGREE DEGREE1 DEGREE2
1 BS
1 MS
1 PHD
2 BA
2 MA
我期待得到以下结果
ID DEGREE DEGREE1 DEGREE2
1 BS MS PHD
2 BA MA
我有以下表重复的记录
ID DEGREE DEGREE1 DEGREE2
1 BS
1 MS
1 PHD
2 BA
2 MA
我期待得到以下结果
ID DEGREE DEGREE1 DEGREE2
1 BS MS PHD
2 BA MA
简单aggregration和最大应该这样做..
SELECT ID, max(Degree) degree, max(Degree1) degree1, max(Degree2) Degree2
FROM table
GROUP BY Id
(必须是基于C/java程序员0的学位,尽管他们有3个)。
这确实假设每行/ id只有1度。