表中包含多条包含字段mID的数据,但有重复
现在要
取出不重复的数据的全部记录
怎样取?

解决方案 »

  1.   

    select distinct mID from table
      

  2.   

    select * from table1 where id in (select min(id) from table1 group by mId)
      

  3.   


    select distinct * from tableName
      

  4.   

    select distinct mID from table
      

  5.   

    sql语句中两种查询不重复纪录的方法SELECT   DISTINCT   id   FROM   [table] 
    SELECT   *   FROM   table1   WHERE   [ID]   IN   (SELECT   MIN([ID])   from   table1   GROUP   BY   [ID]) 
      

  6.   

    select distinct mID from table
      

  7.   

    select mId,max(column1) as column1,max(column2) column2,max(column3) as column3
    from table1
    group by mId
      

  8.   

    select distinct mID from table,
    当这个SELECT语句执行时,只返回一个记录。通过在SELECT语句中包含关键字DISTINCT,你可以删除所有重复的值。
    对了你的数据库是什么?