操作数应该包含1列 - 在mysql查询中

时间:2015-12-16 11:46:34

标签: mysql sql

我有以下复杂查询给我一个错误    操作数应包含1列

任何人都可以提出错误的建议

jwplayer().seek(-jwplayer().getDuration())

1 个答案:

答案 0 :(得分:2)

您的查询可能有多个错误,但WHERE子句中的这种情况肯定是可疑的并且会导致该错误:

AND  (SELECT *
      FROM redeemed_codes t1
      WHERE organisation_id = 1 AND
            (SELECT sum(school_points)
             FROM redeemed_codes t2
             WHERE t2.redeemed_code_id <= t1.redeemed_code_id
            ) >= 1000
      ORDER BY redeemed_code_id
      LIMIT 1
     )

我不知道你要做什么。有时,解决方案只是EXISTS

EXISTS (SELECT *
        FROM redeemed_codes t1
        WHERE organisation_id = 1 AND
              (SELECT sum(school_points)
               FROM redeemed_codes t2
               WHERE t2.redeemed_code_id <= t1.redeemed_code_id
              ) >= 1000
       )