lqxue

          常用鏈接

          統(tǒng)計

          book

          tools

          最新評論

          如何把表1的數(shù)據(jù)換成表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 閱讀(116) 評論(0)  編輯  收藏 所屬分類: database

          主站蜘蛛池模板: 万源市| 灵石县| 台安县| 无棣县| 普洱| 绥德县| 新巴尔虎左旗| 荃湾区| 黎城县| 阿城市| 余姚市| 二手房| 手机| 金阳县| 行唐县| 石城县| 靖西县| 克东县| 乐业县| 屯留县| 锡林郭勒盟| 成武县| 盐池县| 大厂| 鄂托克前旗| 德钦县| 昌平区| 磴口县| 进贤县| 湘潭市| 孟津县| 莒南县| 浮梁县| 闵行区| 清苑县| 海原县| 乐安县| 鄂温| 邹城市| 新巴尔虎左旗| 天峨县|