曾经不会的

1、从一张表中查询出,相同id的数据的所有信息

select * from 表 where id in(select id from 表 group by id having count(*)>1);

2、从一张表中删除,code重复的数据

delete from area a where a.id>(select min(id) from area b where a.code=b.code );

3、从一张表中查询出,去掉code重复的数据

select * from area a where a.id in (select min(id) from area b where a.code=b.code);

posted on 2013-08-09 14:57  世界之大追梦者  阅读(138)  评论(0编辑  收藏  举报

导航