I have a table called productcategory I want to insert two static values to the columns category_name and parent_id and need to insert column sort_order with a value generated from inner select query
INSERT INTO productcategory(category_name,parent_id,sort_order)
values('Flowers',0,(select MAX(sort_order)+1 from productcategory where parent_id=0))
SQL query not working
Thanks in Advance