Can somebody please tell me which is the better way, they both produce the same results but which is more 'correct'?
Personally I feel the first query is easier to read, but I seem to read elsewhere that aliases should always be used.
Thanks
SELECT Patient.PatientSurname, Doctor.DoctorSurname
FROM Patient
JOIN Operation
ON Operation.PatientCode=Patient.PatientCode
JOIN Doctor
ON Doctor.DoctorCode=Operation.DoctorCode
WHERE Operation.OperationType='Broken Arm'
GROUP BY Patient.PatientSurname
HAVING count(Patient.PatientSurname) > 0
SELECT PatientSurname, DoctorSurname
FROM Patient as p, Operation as o, Doctor as d
WHERE o.PatientCode=p.PatientCode
AND d.DoctorCode=o.DoctorCode
AND o.OperationType='Broken Arm'
GROUP BY p.PatientSurname
HAVING count(p.PatientSurname) > 0