所以我在 sql 中有一个表,它看起来像这样
controlnum taxyear payrollg alaska
12334 2012 16 25
12334 2012 16 25
12334 2012 16 NULL
12334 2012 16 NULL
12334 2012 16 25
12334 2012 16 25
12332 2012 14 23
12332 2012 14 NULL
12333 2012 14 23
12333 2012 14 NULL
我想把它弄平
controlnum taxyear payroll alaska
12334 2012 16 25
12333 2012 14 23
12332 2012 14 23
这是我尝试过的查询,它给了我语法错误,有人可以帮忙吗?
SELECT
Controlnum "controlNumber",
taxyear "taxYear",
payrollg "payRollGroup"
FROM
states
MAX (CASE WHEN alaska IS NOT NULL THEN alaska ELSE NULL END) AS 'Alaska'