I want to display all fields in T1 based on a criterial match in T2, but I don't want to display anything from T2.
So when I query
SELECT * FROM Personal
WHERE Personal.P_ID=Exam.P_ID
AND Exam.Level='B2'
AND Exam.Certification='Full'
I get an error (#1054 - Unknown column 'exam.Level' in 'where clause'), because I don't include the T2 (Exam) in Line 1.
But when I query
SELECT * FROM Personal, Exam
WHERE Personal.P_ID=Exam.P_ID
AND Exam.Level='B2'
AND Exam.Certification='Full'
I get all the Exam table data returned as well.
How do I just return all the T1 (Personal) data?
I checked for previous questions and found this: Select data (join?) from only one table using an id from another table , but the answers still return the unwanted T2 data.
For example,
SELECT * FROM Personal
JOIN Exam on Personal.P_ID = Exam.P_ID
AND Exam.Level='B2'
AND Exam.Certification='Full'