SQL 去重复 急! 在线等!

来源:百度知道 编辑:UC知道 时间:2024/06/11 22:31:16
表中字段
stuID, stuName(其中ID自动增长)

1,张三
2, 李四
3,王五
4,张三
5,张三
6,张三
7,李四
8,张三
9,王五 ....

要求去重复的
谢谢各位的回答!我就采纳1楼号了!他最快!

谁能帮我看看另一个比较复杂的SQL查询

http://zhidao.baidu.com/question/100562265.html

SELECT DISTINCT [stuName] FROM [table]

SELECT [stuName],COUNT([stuName]) FROM [table] GROUP BY [stuName]

select DISTINCT stuName from tablename(表名称)

delete students WHERE stuid NOT IN (SELECT MIN(stuid) FROM students GROUP BY stuname)

select min(stuid),stuname from students group by stuname