欢迎投稿

今日深度:

Operand should contain 1 column(s),operandcontain

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 后面只能跟一列.
 

www.htsjk.Com true http://www.htsjk.com/shujukunews/2797.html NewsArticle Operand should contain 1 column(s),operandcontain 今天在sql测试的时候发现了这个错误:Operand should contain 1 column(s)。 原因是in条件后面有多个字段,in后面只能有一个字段。 SQL语句错误,提示:...
评论暂时关闭