select country, sum(case when type='A' then money end) as A,
sum(case when type='B' then money end) as B,
sum(case when type='C' then money end) as C
from table1
group by country
SQL行转列显示
精选 转载上一篇: servlet的转发与重定向
下一篇:我的友情链接
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
SQL——行转列,列转行
SQL——行转列,列转行
sql pivot sql server 手机 数据库