华为一道面试题

一个表中的Id有多个记录,把所有这个id的记录查出来,并显示共有多少条记录数。
------------------------------------------

 

select id, Count*) from tb group by id having count(*)>1
select * from(select count(ID) as count from table group by ID)T where T.count>1

 

posted @ 2010-12-03 23:45  程序员面试助手  阅读(1256)  评论(0编辑  收藏  举报