和你现在的语句类似,只需在后面把其他两个表也加上就行,然后select字段里面加上你需要的字段值即可。 from Student,Speciality,class,bedchamber where Student.specialityid=Speciality.specialityid and student.classid = class.classid and student.bedchamberid = bedchamber.bedchamberid 要使SQL达到最优,需要在表student中给字段specialityid,classid,bedchamberid分别建立索引
from Student,Speciality,class,bedchamber where Student.specialityid=Speciality.specialityid
and student.classid = class.classid and student.bedchamberid = bedchamber.bedchamberid
要使SQL达到最优,需要在表student中给字段specialityid,classid,bedchamberid分别建立索引