查询未返回正确的值

时间:2011-07-12 09:35:10

标签: cakephp mysqli

我的查询如下:

SELECT DISTINCT(FldStrategyID), FldTradeServerName,FldBaseDir,FldBinaryStartTime
FROM TblOrders Ord,
  (SELECT CONCAT(FldStrategyID,'.',FldTradeServerName,'.',FldBaseDir,'.',FldBinaryStartTime) strid
   FROM TblOrders
   GROUP BY FldStrategyID) as OrderView
WHERE Ord.FldStrategyID !=''
  AND OrderView.strid NOT IN (SELECT FldStrategyID FROM TblStrategyMasters WHERE 1)

问题是这部分不起作用:

OrderView.strid NOT IN (SELECT FldStrategyID FROM TblStrategyMasters WHERE 1)

1 个答案:

答案 0 :(得分:0)

我认为某些地方缺少引号(')。