ColdFusion查询查询

时间:2011-03-02 02:18:45

标签: sql coldfusion coldfusion-8 qoq

此查询:

SELECT * FROM getlogs WHERE id > #id# AND logType = "login" LIMIT 1

给我这个错误:

Error Executing Database Query.


Query Of Queries syntax error.
Encountered "logType. Incorrect conditional expression, Incorrect conditional expression, Lexical error at line 0, column 0. Encountered: "\"" (34), after : ""

2 个答案:

答案 0 :(得分:7)

使用最大行:

< cfquery dbType =“query”name“myQ”maxrows =“1”>
SELECT * FROM getlogs WHERE id> #id#AND logType =“login”
< / CFQUERY>

答案 1 :(得分:3)

使用单引号而不是双引号。