1.检索数据1.1 distinct
##用于检索出单一的行值
select distinct vend_id from products.
##distinct 不止作用于其后置字段,它会查出所有列组合情况下单一的列。
select distinct vend_id,vend_name from products.
mysql> select * from test;
+----+------+-------+
| id | name | photo |
+----+------+-------+
| 1 | tony | photo |
| 1 | tom | photo |
| 2 | tony | photo |
| 2 | tom | photo |
| 2 | tom | photo |
+----+------+-------+
5 rows in set
mysql> select distinct id,name from test;
+----+------+
| id | name |
+----+------+
| 1 | t