【1】避免重复——DISTINCT
SELECT DISTINCT job FROM t_enployee;
#去除job字段的重复项,只显示所有job字段中的非重复项,比如job里有:teacher,student,teacher,salesman,student;
使用DISTINCT参数后输出只显示:teacher,student,salesman
SELECT DISTINCT job,age,phonenum FROM t_enployee;
#去除并显示多个字段。
【1】避免重复——DISTINCT
SELECT DISTINCT job FROM t_enployee;
#去除job字段的重复项,只显示所有job字段中的非重复项,比如job里有:teacher,student,teacher,salesman,student;
使用DISTINCT参数后输出只显示:teacher,student,salesman
SELECT DISTINCT job,age,phonenum FROM t_enployee;
#去除并显示多个字段。