select * from table where filed != 'xxx'大致这样

解决方案 »

  1.   

    SELECT distinct 字段名 from 表名
      

  2.   

    select distinct( Field ) from table;
      

  3.   

    select distinct(xxx) from table;select xxx from table group by xxx;
      

  4.   

    select distinct (字段名) from (表明)
      

  5.   

    select xxx from table group by xxx;
    group by 要好点,distinct只能查一个字段出来。要不就做子查询
      

  6.   

    mysql> create table tt (a char(3));
    Query OK, 0 rows affected (0.16 sec)
    mysql> insert into tt value ('123'),('321'),('123'),('321');
    Query OK, 4 rows affected (0.05 sec)
    Records: 4  Duplicates: 0  Warnings: 0mysql> select distinct * from tt;
    +------+
    | a    |
    +------+
    | 123  |
    | 321  |
    +------+
    2 rows in set (0.05 sec)
      

  7.   

    select xxx from table group by xxx;