I want to copy data from two columns in a ‘table1’ to another table ‘table2’ which is empty and has two columns.
insert into users_role_map (email,id) select (email,roleId) from usert ;
when I try to do this I get the error
Operand should contain 1 column(s)
when I try to do the same thing with just one column I am able to copy the entire column data but not for the two columns simultaneously.Can any one help me out and guide me where I am going wrong.
Just remove the
()from theSELECTstatement. They are being parsed as though you were going to do an operation on a column like(id * 9), but MySQL then expects only one column inside the()as an operand. In any case, it’s a total misinterpretation by the query parser, and you should have no().