日期:2014-05-17 浏览次数:20644 次
,我需要查询出字段stuid和proid 相同的行数据

小弟第一次在论坛说话问题目,请各位高人大哥帮帮我,急求!今晚就需要,谢谢了
select a.*
from scoreInfo a
inner join
(select stuid,proid
from scoreInfo
group by stuid,proid
having count(*)>1) b on a.stuid=b.stuid and a.proid=b.proid
select * from scoreInfo a
where exists(select 1 from scoreInfo b
where b.stuid=a.stuid and b.proid=a.proid and b.id<>a.id)