簡易代碼之家

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            157 Posts :: 2 Stories :: 57 Comments :: 0 Trackbacks

          表student結構如下:



          求每個學生分數最高的科目及分數。
           

          SQL:

          select s.* from (select *,row_number() over (partition by name order by score desc) as rownumber from [COMMON].[dbo].[student]) s where s.rownumber=1;

          查詢結果:

          posted on 2012-04-05 17:22 Jakin.zhou 閱讀(232) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 招远市| 明光市| 岳池县| 沈丘县| 瑞昌市| 海伦市| 井冈山市| 镇远县| 赫章县| 荃湾区| 舟曲县| 通辽市| 肃北| 西藏| 江北区| 正安县| 岳西县| 兴城市| 宜兰县| 青岛市| 叶城县| 永福县| 忻州市| 台湾省| 满洲里市| 巨野县| 叶城县| 潢川县| 庆阳市| 郑州市| 耒阳市| 微博| 浦城县| 秦安县| 阿拉善左旗| 葵青区| 阿克| 固原市| 旬邑县| 阜城县| 达尔|