(多对多关系)
马克-to-win:Teacher表:两列id,name。...Studnet表: 三列:id,name,age
TeacherStudent表(关系表):三列:id,tid,sid
create table TeacherStudent(id int not null...TeacherStudent (id,tid,sid) VALUES(2,1,2);
INSERT INTO TeacherStudent (id,tid,sid) VALUES(3,2,2);
qixy的学生显示出来...fuwenlong | 26 | 2 | 1 | 2 |
+----+------+----+-----------+------+----+-----+-----+
huanglaosh的学生显示出来...:(未来springJdbc或mybatisxxxxx的某种技术中也许用的着,因为它严格限制单表游动)
select name from Student where id in (select sid