How can I reset a autoincrement sequence number in sqlite

后端 未结 5 1671
广开言路
广开言路 2020-12-01 15:22

How to update table sqlite_sequence in Ormlite ? I just need update seq. How can I get that table via ORMLite ?

EDIT

I can\'t find ORLite t

5条回答
  •  Happy的楠姐
    2020-12-01 15:34

    Building on Marcos Vasconcelos' answer:

    UPDATE sqlite_sequence SET seq = (SELECT MAX(col) FROM Tbl) WHERE name="Tbl"
    

    This query will set seq to the largest value in the col identity column in the Tbl table, so there is no risk of violating constraints.

提交回复
热议问题