MYSQL的DISTINCT .发现,如果只查询一个列的话,是可以查询得到不重复的记录,但是如果要查询多列的话,就会出错!
但只要在select distinct a,b from TABLE group by a order by b 就可以实现不重复的列的查找了。
正确:select distinct a,b from TABLE group by a order by b
MYSQL的DISTINCT .发现,如果只查询一个列的话,是可以查询得到不重复的记录,但是如果要查询多列的话,就会出错!
但只要在select distinct a,b from TABLE group by a order by b 就可以实现不重复的列的查找了。
正确:select distinct a,b from TABLE group by a order by b