Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I use ROWNUM in a subquery (emulating SQL Server TOP n)
I suggested this solution to Gosta and in case it might help someone
else I'm posting it here too. I works only for "TOP 1" type queries
since the subquery will only return one value
SELECT DISTINCT
e.surname, e.firstname
FROM Employee e, EmployeeBenefitRecord ebr, EmployeePensionOption epo,
PensionOption po, PensionScheme ps, BenefitProgramme bp, BenefitGroup
bg
WHERE e.id = ebr.employeeId AND ebr.id = epo.employeeBenefitRecordId AND ebr.benefitGroupId = bg.id
Erik Received on Mon Dec 06 2004 - 06:15:01 CST