开发者

Insert and retrieve the old value (MySQL php)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜