开发者

Insert and retrieve the old value (MySQL php)

开发者 https://www.devze.com 2023-03-29 16:20 出处:网络
I have a table with columns: [id, value] (id = integer PK, value= integer). I\'d li开发者_如何学Goke to update the value column for a given id, retrieveing the old value. Is posible to do this in a si

I have a table with columns: [id, value] (id = integer PK, value= integer). I'd li开发者_如何学Goke to update the value column for a given id, retrieveing the old value. Is posible to do this in a single query? or I need to make a query and then an insert?

Thanks in advance


You could create a trigger that puts the old value in another table (or even into another column of the current table). Other than that, you'd need to do two queries.

0

精彩评论

暂无评论...
验证码 换一张
取 消