With Multiple Tables & Criteria Still Can't Get this one
After checking MS Knowledge refs, can't seem to get the SQL right. And have never quite understood the statement RIGHT JOIN.
I've 50k names, want the Top 15 by salary (Fld Poscode228.To) in each Department (Fld Govdoug.Deptcode)
Here's the SQL code (without any reference to the Top 15):
SELECT GOVDOUG.Name_ID AS TenMostHighestPaid, GOVDOUG.F1_ECON30503, GOVDOUG.Deptcode, POSCODE228.To, STRDIV.DVNAME, STRBRANCH.BRNAME, GOVDOUG.Sect1, DEPT228.State
FROM STRDIV RIGHT JOIN (STRBRANCH RIGHT JOIN (POSCODE228 RIGHT JOIN (DEPT228 RIGHT JOIN GOVDOUG ON DEPT228.dept_id = GOVDOUG.Deptcode) ON POSCODE228.Poscode = GOVDOUG.Poscode) ON STRBRANCH.Branchcode = GOVDOUG.Branchcode) ON STRDIV.Divcode = GOVDOUG.Divcode
WHERE (((GOVDOUG.F1_ECON30503)=Yes))
ORDER BY GOVDOUG.Deptcode, POSCODE228.To DESC;
Any help really apprecaited