Operand should contain 1 column(s),operandcontain

來源:互聯網
上載者:User

Operand should contain 1 column(s),operandcontain

   今天在sql測試的時候發現了這個錯誤:Operand should contain 1 column(s)。

原因是in條件後面有多個欄位,in後面只能有一個欄位。


SQL語句錯誤,提示:"#1241 - Operand should contain 1 column(s)"錯誤

IN 謂詞右邊括弧裡的子查詢只能輸出1個欄位,但是你的子查詢使用了符號“*”,這樣資料庫引擎會將es_message表中的所有欄位 都輸出到IN右邊的括弧裡,當然就會報錯了。

改正方法:在子查詢的SELECT 後面僅指定一個需要比較的欄位即可。
 
SQL語句錯誤:提示:"#1241 - Operand should contain 1 column(s)"錯誤

SELECT * FROM ies_message where msgsendtype=2
查詢出來的是幾列,
msgsendtype IN 後面只能跟一列.
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.