I am working with MySQL 5.0.45 in a remote server. Now I am using subqueries and it seems that doesn’t work. I receive the same error msg about syntax: #1064 - You have an error in your SQL syntax; check the manual…
I have tried in different ways modifying the instructions but I receive same error. Here are the last instructions:
[code]SELECT ‘Student ID’
FROM (
SELECT Students. ‘Student ID’, Students. ‘Student Name’, Students. ‘School Code’
FROM Students
WHERE (
Students. ‘School Code’ =133821
)
) AS Q1
WHERE ‘Student ID’ <> ANY(
(
SELECT DISTINCT Students. ‘Student Name’, School Tutoring Dates
.Date, Students. ‘Student ID’
FROM School Tutoring Dates
INNER JOIN (
Students
INNER JOIN Students Attendance
ON Students. ‘Student ID’ = Students Attendance
. ‘Student ID’
) ON School Tutoring Dates
. ‘School Date Id’ = Students Attendance
. ‘School Date Id’
WHERE (
School Tutoring Dates
.Date
) = ‘2001-01-01’
)
[/code]Before, I didn’t use the “ANY” and it was different the queries but anyway I received the syntax error message. It is about the very first line. Here is the exact message:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Student ID', Students.'Student Name', Students.'School Code' FROM Students WH' at line 1The former query was [code]SELECT query2.'Student ID' , query2.'Student Name', query2.'School Code' FROM (SELECT Students.'Student ID', Students.'Student Name', Students.'School Code' FROM Students WHERE (Students.'School Code'=133821)) AS query2 LEFT JOIN (SELECT DISTINCT Students.'Student Name', `School Tutoring Dates`.Date, Students.'Student ID' FROM `School Tutoring Dates` INNER JOIN (Students INNER JOIN `Students Attendance` ON Students.'Student ID' = `Students Attendance`.'Student ID') ON `School Tutoring Dates`.'School Date Id' = `Students Attendance`.'School Date Id' WHERE (`School Tutoring Dates`.Date)='2001-01-01') AS query1 ON query2.'Student ID'=query1.'Student ID' WHERE (query1.'Student ID' Is Null)[/code] IN ACCESS, the equivalent in syntaxis did work.
I’ll appreciate any help. Thanks.