...
SELECT distinct * FROM (
SELECT * FROM
--STAFF ONLY
(SELECT pers.perslastname as lastname,
pers.persfirstname as firstname,
pers.perspicture as photo,
sect.sectname,sect.sectdescr,
pers.persworklocation,
pers.persitsusername as username,
pers.persemail,
pers.persworkphone1,
pers.persworkphone2,
pers.persworkphone2type,
pers.persworkfax,
ppos.pposmanager as supervisor,
'staff' as emptype
FROM personnel pers,
persposition ppos,
section sect
WHERE pers.persid = ppos.persid
AND ppos.pposstatus = 'A'
AND ppos.sectid = sect.sectid
) staff
UNION ALL
SELECT * FROM
--STUDENT ONLY
(SELECT upper(stdlink.stdlastname) as lastname,
upper(stdlink.stdfirstname) as firstname,
personnel.perspicture as photo,
section.sectname,section.sectdescr,
personnel.persworklocation,
personnel.persitsusername as username,
personnel.persemail,
personnel.persworkphone1,
personnel.persworkphone2,
personnel.persworkphone2type,
personnel.persworkfax,
CONLINK.contactfirstname || ' ' || CONLINK.contactlastname as supervisor,
'student' as emptype
FROM SECEADM.placement@secedb_link PLCLINK,
SECEADM.student@secedb_link STDLINK,
SECEADM.jobcontacts@secedb_link SUPLINK,
SECEADM.contact@secedb_link CONLINK,
personnel,
persposition,
section
WHERE PLCLINK.plcStatus = 'A'
AND PLCLINK.stdId = STDLINK.stdId
AND PLCLINK.plcId = PERSPOSITION.empId
AND PLCLINK.plcjobid = SUPLINK.jobid
AND SUPLINK.aprid = 2
AND SUPLINK.contactid = CONLINK.contactid
AND STDLINK.stdUhuuid = PERSONNEL.persUhuuid
AND PERSONNEL.persId = PERSPOSITION.persId
AND PERSPOSITION.sectId = SECTION.sectId
) std
)
ORDER BY sectname, lastname, firstname;