1.Mysql中按某一字段去重,并查询去重后的所有字段SELECT pnum, name FROM products AA WHERE id = (SELECT MIN(id) FROM products BB WHERE BB.pnum = AA.pnum GROUP BY BB.pnum);