当前位置: 代码迷 >> 综合 >> MySQL导数据报错[Err] 1241 - Operand should contain 1 column(s)
  详细解决方案

MySQL导数据报错[Err] 1241 - Operand should contain 1 column(s)

热度:24   发布时间:2023-12-13 11:39:24.0

这个语句的出现多是因为将select 的结果集用()包住了。

原来的sql:

insert into ubi_user_company (organization,organizationName)
select (a.organization,a.organizationName) from bigdata_fee_user_info_200412 a where a.userId is not null

修改后的sql:

insert into ubi_user_company (organization,organizationName)
select a.organization,a.organizationName from bigdata_fee_user_info_200412 a where a.userId is not null

  相关解决方案