lqxue

常用链接

统计

book

tools

最新评论

如何把表1的数据换成表2的形式







select  max(a.num) A,max(b.num) B,max(c.num) C,tttt.name from tttt
left join (select * from tttt where abc='C') c on c.abc=tttt.abc and c.name=tttt.name
left join (select * from tttt where abc='B') b on b.abc=tttt.abc and b.name=tttt.name
left join (select * from tttt where abc='A') a on a.abc=tttt.abc and a.name=tttt.name
group by name

posted on 2008-07-16 11:18 lqx 阅读(110) 评论(0)  编辑  收藏 所属分类: database


只有注册用户登录后才能发表评论。


网站导航: