PostgreSQL 一句 SQL 实现删除数据后插入到历史表中

PostgreSQL About 182 words

with 语句

with deleted_rows as (
    delete from t_queue where id = '12345' returning *
)
insert into t_queue_history(id, create_ts, data)
select id, create_ts, data
from deleted_rows;
Views: 140 · Posted: 2024-06-29

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Today On History
Browsing Refresh