答案 0 :(得分:1)
所以你需要一个案例表达式:
SELECT Road,CASE WHEN maried = 1 then salary else food end as NewValue
FROM(select Road,
max(CASE WHEN Parameter = 'maried' then value end) as maried,
max(CASE WHEN Parameter = 'salary' then value end) as salary,
max(CASE WHEN Parameter = 'food' then value end) as food
FROM myTable
GROUP BY Road)
这将为您提供每个独特的ROAD LOGIC。