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 閱讀(117) 評論(0)  編輯  收藏 所屬分類: database

          主站蜘蛛池模板: SHOW| 五华县| 巴楚县| 兰州市| 南皮县| 黄浦区| 油尖旺区| 天峨县| 基隆市| 安丘市| 商水县| 临高县| 灵石县| 手机| 冕宁县| 安丘市| 砀山县| 台州市| 石屏县| 凤山县| 紫金县| 贵阳市| 秦皇岛市| 喜德县| 平山县| 萨嘎县| 扎囊县| 怀来县| 响水县| 新宁县| 乐平市| 阳江市| 凯里市| 辛集市| 文登市| 鄂温| 汉中市| 射洪县| 岑溪市| 姜堰市| 浙江省|