I have three table in a database that are joined together. The problem I am having is when I do a search for a candidate that Primary Key and Foreign Key begins with leading zeros the query will not return the data. I have confirmed that the data exist in the database. Here is an example of the query.
SELECT *
FROM candidate_exam
INNER JOIN candidate
ON candidate_exam.idcandidate = candidate.idcandidate
INNER JOIN exam
ON candidate_exam.exam_id = exam.exam_id
WHERE candidate.idcandidate = '000011111'
AND candidate.lname = 'testlastname'
AND candidate_exam.alpha_exam_score = 'Pass'