MySQL update query with WHERE clause and INNER JOIN not working
The query should be as below, you have joined the same table and hence the problem of unique alias. I have added table alias for better readability.
UPDATE
sales_flat_order sfo
INNER JOIN sales_flat_order_grid sfog
ON sfog.entity_id = sfo.entity_id
SET sfo.coupon_code = "newcoupon"
WHERE sfog.increment_id = "12345678" ;