Search code examples
mysqlsqlsubquerywhere-clause

#1241 - Operand should contain 1 column(s) update case


I keep having this error when I try this :

update table1
set value1="apple"
where id IN (
select * table1_table2 where value2= "juice"
)

Solution

  • you can not select multiple column inside in clause

    update table1
    set value1="apple"
    where id IN (
    select id from table1_table2 where value2= "juice"
    )