Return pre-UPDATE column values using SQL only

后端 未结 4 1983
萌比男神i
萌比男神i 2020-11-27 03:25

I posted a related question, but this is another part of my puzzle.

I would like to get the OLD value of a column from a row that was UPDATEd - WITHOUT using triggers

4条回答
  •  鱼传尺愫
    2020-11-27 03:54

    when faced with this dilemma I added junk columns to the table and then I copy the old values into the junk columns (which I then return) when I update the record. this bloats the table a bit but avoids the need for joins.

提交回复
热议问题