SQL/mysql - Select distinct/UNIQUE but return all columns?

前端 未结 18 1142
忘掉有多难
忘掉有多难 2020-11-22 12:08
SELECT DISTINCT field1, field2, field3, ......   FROM table

I am trying to accomplish the following sql statement but I want it to return all colum

18条回答
  •  梦谈多话
    2020-11-22 12:16

    SELECT *
    FROM tblname
    GROUP BY duplicate_values
    ORDER BY ex.VISITED_ON DESC
    LIMIT 0 , 30
    

    in ORDER BY i have just put example here, you can also add ID field in this

提交回复
热议问题