我有以下结构。 | ID |值|
| A | V1 |
| B | V2 |
| C | V3 |
| d | V4 |
需要输出。
| A | C | Ç| d |
| V1 | V2 | V3 | V4 |
我尝试了很多,但可以获得成功
select case when t1.id = 'a' then t1.value end as a ,
case when t1.id = 'b' then t1.value end as b ,
case when t1.id = 'c' then t1.value end as b ,
case when t1.id = 'd' then t1.value end as d
from
t1
请告知。
由于
答案 0 :(得分:1)