Paul Ritchie wrote:
> Can anyone quide me as to what is wrong with my first statement, why it takes so long to process
> (a good 20 to 30 seconds) compared to 2 seconds using the second statement.
Nothing. It's probably an optimizer issue. What do you get when you run
EXPLAIN SELECT ....
for this query?
How does the following work?
SELECT
positionTitle
FROM staff s
JOIN departmentLink dl ON dl.staffId = s.staffId
JOIN departmentInfo di ON di.departmentNumber = dl.departmentNumber
WHERE
di.classificationId = $classificationId and
di.contactId = $contactId and
di.branchId = $branchId and
di.departmentId = $departmentId
--
felix
Please use
BBCode to format your messages in this forum.