繁体   English   中英

eclipse中mysql的错误语法是什么

[英]What is the error syntax mysql in eclipse

String queryString = "select DISTINCT students.firstName, teacher.firstName, Course.title" + 
  " from Student,Faculty,Course ,(select Student.ssn, Student.firstName, Enrollment.courseId" + 
  "from Enrollment, Student" + 
  "where Enrollment.ssn = Student.ssn )as students," + 
  "(select Faculty.ssn, Faculty.firstName, TaughtBy.courseId" + 
  "from TaughtBy, Faculty where TaughtBy.ssn = Faculty.ssn )as teacher" +
  "where Student.ssn = ?  and Faculty.ssn = ? and students.courseId = teacher.courseId" ;

这个SQL查询在SQL Server中工作,但在MySQL中不工作。 请帮我!

您必须遇到空格,请在双引号之前或之前尝试一个空格 ,例如:

String queryString = "select DISTINCT students.firstName, teacher.firstName, Course.title"+ " from Student,Faculty,Course ,(select Student.ssn, Student.firstName, Enrollment.courseId"+ " from Enrollment, Student"+" where Enrollment.ssn = Student.ssn )as students,"+" (select Faculty.ssn, Faculty.firstName, TaughtBy.courseId"+ " from TaughtBy, Faculty where TaughtBy.ssn = Faculty.ssn )as teacher"+ " where Student.ssn = ? and Faculty.ssn = ? and students.courseId = teacher.courseId" ;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM