Name the class grade teacher
1 1 10 Lin zhang 1
Zhang Lin 2 2 2 11
3 3 12 zhang Chen 3
4 4 13 Lin 4
5 5 14 Lin zhang
Table 2
Name the class grade teacher
1 June 10 Chen li 1
Chen li 2 July 11 2
Chen li 3 8 12 3
4, 9, 13 Chen li 4
5 10 to 14 Chen li
Now to get a result,
From table 1 according to the conditions (teacher) to find the "3" Chen associated records, need to be in the conditions of the "3" Chen lookup table two correlation record, at the same time show
Single table query
Grades, name, select a. a. a. class, teacher b.
From table 1 a left join teachers bon ID=b ID
Where b. teacher='Chen 3'
CodePudding user response:
The original poster is the problem?CodePudding user response: