The error showing
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
i think an error in the syntax
update invoice AS t1,
(select sum(total_cost) from invoice where billno='X-0125' and item='11') AS t2
set t1.total_cost=(t1.total_cost/(t2.sum(total_cost))*100
WHERE t1.billno='X-0125' and t1.item='11'
set t1.total_cost=(t1.total_cost/(t2.sum(total_cost))*100I Think you miss)