怎么去除数据库表中的重复数据留一个

怎么去除数据库表中的重复数据,留下其中的一个数据即可!!!!!!!!!!!!!

比如查询某个字段的时候:select xxx from xxxtable,只要在要查询的字段前面加上distinct关键字即可实现

http://www.runoob.com/sql/sql-distinct.html
distinct关键字,具体用法看链接

select distinct * from 表

select distinct * 或(要查询的字段) from 表名;
当然,按需要其实分组查询也有去除重复的效果,只是意义不同
分组是在代码最后加上group by (要分组的字段)

select distinct * from 表名

delete from tablename where rowid not in (select max(rowid) from tablename group by 根据哪个重复字段删除);

最好的办法办法,将数据读入数据集中,通过二循环,循环读取一行值,再循环找到其它相同同字段的行,将其删除。