回复 10楼 crszf
10楼的朋友 你写的语句得到的是ID和BIANHAO连起来的字符串 不能得到我想要的结果
SELECT DISTINCT A.BIANHAO,A.SHULIANG FROM TABLE A
INNER JOIN (SELECT BIANHAO,MAX(SHULIANG) as MSL FROM TABLE GROUP BY BIANHAO) B
ON ISNULL(A.BIANHAO,'')=ISNULL(B.BIANHAO,'') AND A.SHULIANG=B.MSL
这样查询的结果集中就不能有ID列,不然由于ID是唯一的,结果集中BIANHAO肯定是会有重复值的