Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select grupa,an from (
- select t1.cnt1/t2.cnt2, t1.grupa, t1.an from
- (select count(*) as cnt1, s1.grupa, s1.an from
- studenti s1 join prieteni p on s1.id=p.id_student1 join studenti s2
- on s2.id = p.id_student2 and s1.grupa=s2.grupa and s1.an=s2.an
- group by s1.grupa, s1.an) t1
- join
- (select count(*) as cnt2, grupa, an from studenti
- group by grupa,an) t2
- on t1.an=t2.an and t1.grupa=t2.grupa order by 1 desc) where rownum=1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement