mysql insert query with mix of static value and inner select query -


i have table called productcategory want insert 2 static values columns category_name , parent_id , need insert column sort_order value generated inner select query

insert productcategory(category_name,parent_id,sort_order)  values('flowers',0,(select max(sort_order)+1 productcategory parent_id=0)) 

sql query not working
in advance

it should work this:

insert productcategory(category_name,parent_id,sort_order) select 'flowers', 0, max(sort_order)+1   productcategory  parent_id = 0 

Comments