MySQL error 1241: Operand should contain 1 column(s)
Syntax error, remove the ( ) from select. insert into table2 (name, subject, student_id, result) select name, subject, student_id, result from table1;
Syntax error, remove the ( ) from select. insert into table2 (name, subject, student_id, result) select name, subject, student_id, result from table1;
Your subquery is selecting two columns, while you are using it to project one column (as part of the outer SELECT clause). You can only select one column from such a query in this context. Consider joining to the users table instead; this will give you more flexibility when selecting what columns you want from … Read more
There’s always this: select * from campaigns where id not in ( select id_campaign from ( select e.id_campaign as id_campaign, d.frequency, e.id from campaigns d left join served e on d.id = e.id_campaign where d.status=”Active” group by e.id_campaign having count(e.id) < d.frequency ) )
Try removing the parenthesis from the SELECT clause. From Microsoft TechNet, the correct syntax for an INSERT statement using a SELECT clause is the following. INSERT INTO MyTable (PriKey, Description) SELECT ForeignKey, Description FROM SomeView The error you’re getting, “The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or … Read more