I need to update a table with 2 values, one of them is a column of another table and the second is a number (constant 1), here is my code:
insert into table (col1, col2)
select colA from table2, '1'
where DATA_FORMAT(table2.created_at, '%y %m %d') = DATA_FORMAT(Now(), '%y %m %d');
The error message is:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0', '1', '1' where DATA_FORMAT(newsletter.created_at, '%y %m %d') = DATA_FORMA' at line 2
Try this: