mysql查询语法

时间:2012-08-31 09:56:09

标签: mysql

SELECT count(AES_DECRYPT(xyz.answertext , "aaa"))*100 / (
FROM xyz
INNER JOIN abc
ON xyz.prim_key = abc.hhid
INNER JOIN jkl
ON jkl.psu = abc.psu
WHERE columnname = 'Q08' )

我正在运行上面的查询,但我收到一个错误:

#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 'FROM xyz INNER JOIN abc ON xyz.prim_key = abc' at line 2

请帮我解决这个问题..

1 个答案:

答案 0 :(得分:2)

尝试

SELECT count(AES_DECRYPT(xyz.answertext , "aaa"))*100 
FROM xyz 
INNER JOIN abc 
ON xyz.prim_key = abc.hhid 
INNER JOIN jkl 
ON jkl.psu = abc.psu 
WHERE columnname = 'Q08'

在from之前有一个额外的括号和除法符号。如果你真的试图划分,那么你需要划分一些东西!