0

我的表由以下组成

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
4

1 回答 1

0
select country, type, max(A), max(B), max(C), max(D), cType
from whatever_table
group by country, type, cType
于 2013-04-03T16:39:39.540 回答