select * from table group by 字段

解决方案 »

  1.   

    select distinct(field_name) from table
      

  2.   

    SELECT DISTINCT(field) FROM tbl;
      

  3.   

    If you want to display all the results but only one of the special column, use "group by" while others use "distinct".
      

  4.   

    SQL出来的就不是重复的,你在下拉框显示出来的肯定也不重复!关键是SQL语句
      

  5.   

    我还有一个问题请教大家,还是表中的那个字段,如何通过sql语句使它的记录相同的项在一起显示列如“2005,2005,20052006,2006,2006......”记录在表中的顺序是杂乱无章的
      

  6.   

    distinct 先去掉重复的再处理``````
    order by 列 ASC or DESC 升序降序排列输出