person表的字段:

person表中的數(shù)據(jù):
查詢:select id,name,sex,age,brithday,address from person;

distinct去除重復(fù):
1.去除重復(fù)的name(去除某一個字段重復(fù)的記錄)
正確: select distinct name,id,sex,age,brithday,address from person; --distinct只能放在查詢的最前面
錯誤: select id,distinct name,sex,age,brithday,address from person; --出錯,缺失表達式

person表中的數(shù)據(jù):
查詢:select id,name,sex,age,brithday,address from person;

distinct去除重復(fù):
1.去除重復(fù)的name(去除某一個字段重復(fù)的記錄)
正確: select distinct name,id,sex,age,brithday,address from person; --distinct只能放在查詢的最前面
錯誤: select id,distinct name,sex,age,brithday,address from person; --出錯,缺失表達式