-3
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

请帮我解决这个问题..

4

1 回答 1

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 之前有一个额外的括号和除法符号。如果您实际上是在尝试除法,那么您需要除以某些东西!

于 2012-08-31T10:02:29.677 回答