我有这样的疑问
SELECT
COUNT(*) AS TotalAmount
FROM
CurrentApplications
WHERE
CurrentApplications.resp_id IN (1)
AND FinalOutcome_date BETWEEN '2013-04-01 00:00:00' AND '2013-04-30 23:59:59'
AND (FinalOutcome >= 1 AND FinalOutcome <= 2)
AND (FIND_IN_SET(14, app_category)
OR FIND_IN_SET(15, app_category)
OR FIND_IN_SET(26, app_category))
它在 MySQL Workbench 中返回值 10。
现在我正在检索这样的查询:
insideResultsSet = insideStatement
.executeQuery("SELECT COUNT(*) AS TotalAmount FROM CurrentApplications WHERE CurrentApplications.resp_id IN(1) AND FinalOutcome_date BETWEEN '2013-04-01 00:00:00' AND '2013-04-30 23:59:59' AND (FinalOutcome >=1 AND FinalOutcome <= 2) AND( FIND_IN_SET(14, app_category) OR FIND_IN_SET(15, app_category) OR FIND_IN_SET(26, app_category)) ");
while (insideResultsSet.next())
{
mResultValues.put((String)(Reflection("Subdivision_of_land_" + RANGE_NAMES[EachMap.getKey()])),
insideResultsSet.getDouble("TotalAmount"));
Fn.Out(insideResultsSet.getDouble("TotalAmount"));
Fn.Out_Stop("SELECT COUNT(*) AS TotalAmount "
+ mCurrentApplications
+ " WHERE CurrentApplications.resp_id " + mResp_authority + " " + "AND "
+ FIELD_FinalOutcome_date + " " + EachMap.getValue() + "AND (" + FIELD_FinalOutcome
+ " >=1 AND " + FIELD_FinalOutcome + " <= " + FIELD_FinalOutComeORRAHighNumber + ") "
+ getCommaSeachSQL_AppCategory_Multi(new int[]{14,15,26}));
}
Fn.Out_Stop 查询工作 100%,但是当我直接输出结果时结果甚至无效。
结果为 0,对象类型为 null。谁能解释这里发生了什么?对我来说奇怪的错误,因为这对 400 多个其他查询都有效。