SQL Query tuni ng

CLOSED
Bids
31
Avg Bid (USD)
$34
Project Budget (USD)
$10 - $30

Project Description:
Hi, I need someone to optimize below SQL Query. This is run against a large database. The cross join hurts so do the CHARINDEX AND CONVERT.

SELECT * FROM bank_import AS A4
INNER JOIN
(
SELECT bank_import.ID AS ImportID, bank_import.Motif, substring(bank_import.Motif, 1, 1) As Location, bank_import.IsArchived AS BankArchived,
students_enroll.ID AS EnrollID, students_enroll.Language, students_enroll.ClasseID, students_enroll.Tariff, students.FirstName,
students.LastName, students.Address, students.PostCode, students.Locality, students.ID AS StudentID
FROM students
INNER JOIN students_enroll ON students.ID = students_enroll.StudentID
CROSS JOIN bank_import
WHERE (((CHARINDEX(CONVERT (VARCHAR, students_enroll.StudentID),bank_import.Motif) > 0))
AND ((CHARINDEX(CONVERT (VARCHAR, students_enroll.ID),bank_import.Motif) > 0)) OR ((CHARINDEX(CONVERT (VARCHAR, students_enroll.OldID), bank_import.Motif) > 0)))
AND bank_import.IsArchived=0 AND (students_enroll.CycleID=19 OR students_enroll.CycleID=18)
)
As A5 ON A4.ID = A5.ImportID WHERE A4.MatchFound=0 AND A4.DateReleve='2014-01-29'

Skills required:
SQL
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$ 30
in 1 days
Hire angan
$ 20
in 1 days
Hire schungur
$ 35
in 3 days
$ 55
in 1 days
$ 30
in 1 days
$ 35
in 1 days
Hire DeoTech
$ 35
in 3 days
Hire codetod
$ 45
in 5 days
$ 44
in 0 days
$ 34
in 3 days