mysql中distinct去除结果集中重复的数据
mysql中distinct去除结果集中重复的数据sql语法代码:
mysql> select all stuaddress from stu;
+------------+
| stuaddress |
+------------+
| 北京 |
| 北京 |
| 天津 |
| 河南 |
| 河北 |
| 北京 |
+------------+
6 rows in set (0.00 sec)
-- 去除重复的项
mysql> select distinct stuaddress from stu;
+------------+
| stuaddress |
+------------+
| 北京 |
| 天津 |
| 河南 |
| 河北 |
+------------+
4 rows in set (0.00 sec)
页:
[1]