-1
我已經將我的數據庫從MSQL轉換到MySQL,我得到以下錯誤。正確的語法的MySQL服務器版本使用附近'VARCHAR(500))
錯誤消息:您的SQL語法錯誤;檢查對應於你的MySQL服務器版本正確的語法的線附近的「VARCHAR(500))=‘男’AND Responses.res_void = 0」使用手冊22
我不能工作的問題,它看起來對我有效嗎?有沒有MySQL不在這裏?
SELECT
Responses.res_col AS answer
,Responses.res_created AS dateCreated
,Responses.res_notes AS note
,Responses.question_id AS questionID
,Responses.res_id AS responseID
,Responses.student_id AS studentID
,Responses.res_answer AS subQuestion
,Responses.survey_id AS surveyID
,Responses.res_void AS void
,Student.res_answer AS filter
FROM
Responses, Responses AS Student
WHERE
Responses.student_id = Student.student_id
AND
Responses.survey_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.surveyID#">
AND
Student.survey_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.surveyID#">
AND
Responses.question_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.questionID#"> AND
CAST(Student.res_answer AS VARCHAR(500)) = '#arguments.filter#'
AND Responses.res_void = <cfqueryparam cfsqltype="cf_sql_bit" value="#arguments.void#">
@ ta.speot.is在哪裏?此代碼在MSSQL上運行。 – GrantU
然而你把它標記爲MySQL。哪一個? – Bojangles
@Bojangles閱讀OP的*第一行*:*我已將數據庫從MSQL轉換爲MySQL,並且出現以下錯誤*,因此他將查詢從MSSQL轉換爲MySQL。 – h2ooooooo