Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT fio, count(*)
- FROM(
- SELECT fio, fac_id, count(*) as kol
- FROM (
- SELECT entrant.surname || ' ' || entrant.name ||
- CASE WHEN entrant.patronymic IS NOT NULL THEN ' ' || entrant.patronymic ELSE '' END AS fio,
- speciality.faculty_id AS fac_id
- FROM entrant, allset, speciality
- WHERE entrant.delete='0'
- AND entrant.allset_id = allset.id AND allset.speciality_id = speciality.id) AS allfacs
- GROUP BY 1,2
- ) AS distfacs
- GROUP BY 1
- HAVING count(*)>1
- ORDER BY 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement