0
添加到SQL结果比如我有一个表:如何一列从其他行中同一个表
num | value | info
1 | a | test2
2 | a | test1
1 | b | specialinfo
3 | a | test3
而且我有一个查询
select *
from t
where value='a'
这将导致
1 a test2
2 a test1
3 a test3
但我想为b
添加info
作为不是新行,而是作为附加列,所以它会如:
1 a test2 specialinfo
2 a test1 null
3 a test3 null
因此值specialinfo
作为附加列而不是附加行。
对于这种情况select * from t where value IN ('a','b')
将无法正常工作
是有可能做到这一点?