Reputation: 59
I just wanted to know how should look my sql query to make an update of one value in the last row of my table. I tried to do this by query which is unfortunately not working:
UPDATE tableName SET food=888 WHERE id=(SELECT MAX(id) FROM tableName)
I tried to use this query instead but it's incorrect aswell:
UPDATE tableName SET food=88 ORDER BY id DESC LIMIT 1
(I missed quotation marks in queries on purpose to make them clearly)
Upvotes: 2
Views: 2115