Home  >  Article  >  Database  >  查询语句很复杂-mysql由四张表查出一张新的表,sql语句太复杂,求助!!!!

查询语句很复杂-mysql由四张表查出一张新的表,sql语句太复杂,求助!!!!

WBOY
WBOYOriginal
2016-06-06 09:36:121002browse

查询语句很复杂mysqlsql不会写求助

  1. 我要查出学生的学号,班级,姓名,选课题目,指导老师,下面是4张表的结构:
  2. 1. 学生信息表(tstudentInfo):ID,class,name2.老师信息表(tteacherInfo):ID,name3.课题表(tproject):teacherID ,projectID,projectName4选课信息表(tchoiceInfo):studentID,firWish,secWish,firState,secTate每个学生在选课信息表(tchoiceInfo)里都有一条记录,每个学生都有2个志愿,只有一个会被选择,(firWish,secWish里填的就是学生选择的课题的ID),被选择的志愿状态会被设置成1
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn