这两条只要随便一条记录就好,因为我需要除了turn其他所有字段的值,谢谢

解决方案 »

  1.   

    就是取得的记录集要保证userid唯一
      

  2.   

    id  fid  type    turn    userid
    1   76    1       0       11
    1   76    1       1       22
    1   76    1       2       22
    2   76    1       3       33select id,fid,type,max(turn),distinct userid from table1
    group by id,fid,type,userid
    先试试
      

  3.   

    select top 3 * from test where userid in (select userid from test group by userid having count(userid)=1)
      

  4.   

    SELECT DISTINCT 
          userid, MAX(id) AS id, MAX(fid) AS fid, MAX(type) AS type, MAX(turn) 
          AS turn
    FROM TABLE1
    GROUP BY userid
    应该是这样才对!
      

  5.   

    mybios
    我给了分啊,现在要斑竹通过才能给你加上吗,
    问题解决了,谢谢