Hi All,
I need some help speeding up this SQL Query. The problem is with this join
The Query only returns 7 records as that is all there is but the part table is quite large and takes some time.
Here is the full Query
Any help will be great.
Cheers,
sfx
I need some help speeding up this SQL Query. The problem is with this join
Code:
LEFT JOIN
part P1 ON J1.partnumber = P1.partnumber
Here is the full Query
Code:
SELECT
C1.apptdate,
C1.callnumber,
C1.custtitle,
C1.custsurname,
C1.custaddress1,
C1.custaddress4,
C1.custpostcode,
P1.partdescription,
J1.partnumber,
J1.quantity
FROM
call C1
LEFT JOIN
jobpart J1 ON C1.callsurrogate = J1.callsurrogate
LEFT JOIN
part P1 ON J1.partnumber = P1.partnumber
WHERE
C1.apptdate BETWEEN '20010101' AND '20060101'
AND
C1.callsurrogate
IN
(
SELECT
J1.callsurrogate
FROM
jobpart J1
)
ORDER BY
C1.apptdate asc,
C1.callnumber asc
;\g
Cheers,
sfx