select aa,count(*) cnum from ls group by aa having count(*) > 1;=========================== oldwain --------------------------- http://www.itpub.net/index.php?referrerid=32 http://www.linuxforum.net/ http://expert.csdn.net/ http://www.oraclefan.net/
很有道理,一定要先分组再筛选,不能用where,要不就成先筛选后分组了。
select * from vpfhs a where rowid<(select max(rowid) from vpfhs where vpf=a.vpf)
fsb_12345(myself) 的语句可执行,但每一次求 max(rowid) 不理解,执行无效果。这是个很有用的语句,一般用于删除重复记录delete from vpfhs a where rowid < (select max(rowid) from vpfhs where vpf=a.vpf);
有没有一句 把全部重复的记录的内容都列出来 类似于 select * from (select aa,count(*) cnum from ls group by aa) where cnum>1;
select aa,count(*) cnum from ls group by aa having count(*) > 1; 老斗斗的对
oldwain
---------------------------
http://www.itpub.net/index.php?referrerid=32
http://www.linuxforum.net/
http://expert.csdn.net/
http://www.oraclefan.net/
oldwain(老斗) 方法没错
fsb_12345(myself) 的语句可执行,但每一次求 max(rowid) 不理解,执行无效果。
老斗斗的对