How can I insert the return of DELETE into INSERT in postgresql?

后端 未结 5 2187
闹比i
闹比i 2021-02-07 02:23

I am trying to delete a row from one table and insert it with some additional data into another. I know this can be done in two separate commands, one to delete and another to i

5条回答
  •  无人及你
    2021-02-07 03:04

    As "AI W", two statements are certainly the best option for you, but you could also consider writing a trigger for that. Each time something is deleted in your first table, another is filled.

提交回复
热议问题