MYSQL return results where there exist at least one from the other table -
Say I have data from these two tables:
Student table column: < Pre> Course table column: And I want to use the student and course as Student.id. To obtain the following course as a course: How do I ask it, with only one course, and the students will return with their other courses: ? I have tried: but only me ID | Name
id | Code | Name
Student Course ----------------- 1 | C1 | B1 | A2 F2 | B2 | A3 C3 | B3 | F
Student Course ----- ------------ 1 | C1 | B1 | A3 C3 | B3 | F
Choose Student.id, Course Course Course Inner Student On Course. Study = Student. ID where course. Code = 'C'
student. Course ----------------- 1 | C3 | C
select s.id, c c course c INNER JOIN student C. on S. Where studied = s.id is present (from selection 1 to course c 1 where c. Studded = c 1. student and c 1. course = 'c')
Comments
Post a Comment