I am getting a syntax error in case statement in mysql.
1064- you have an error in your sql statement.
insert into
abc_table(release_date,title,detail,num)
select model1.release_date,model1.title,model1.detail,model1.num
CASE
WHEN model1.num= 0 THEN 3
WHEN model1.num= 1 THEN 1
WHEN model1.num= 2 THEN 2
END AS model1.num
from def_table model1
Is this syntax is correct in mysql
You have two columns for
model1.num:Your code should be:
Note: Sometimes, formatting your code will help find these errors. It can be difficult to see when all of the columns are in one row.