我的表格由以下内容组成
Country | Type | A | B | C | D | cType
------------------------------------------------------------------
Italy | Foreign | | | C | D | Commercial
Italy | Foreign | A | B | | | Commercial
Italy | Local | | | C | D | Gov
Italy | Local | A | B | | | Gov
我想使用类型
进行如下结果的查询Italy | Foreign | A | B | C | D | Commercial
Italy | Local | A | B | C | D | GOV
答案 0 :(得分:0)
select country, type, max(A), max(B), max(C), max(D), cType
from whatever_table
group by country, type, cType