SQLite - UPSERT *not* INSERT or REPLACE

后端 未结 18 2584
猫巷女王i
猫巷女王i 2020-11-21 23:53

http://en.wikipedia.org/wiki/Upsert

Insert Update stored proc on SQL Server

Is there some clever way to do this in SQLite that I have not thought of?

18条回答
  •  你的背包
    2020-11-22 00:10

    Having just read this thread and been disappointed that it wasn't easy to just to this "UPSERT"ing, I investigated further...

    You can actually do this directly and easily in SQLITE.

    Instead of using: INSERT INTO

    Use: INSERT OR REPLACE INTO

    This does exactly what you want it to do!

提交回复
热议问题