使用房间数据库(房间持久性库)创建触发器

时间:2017-08-11 06:45:21

标签: android database sqlite android-room

如何使用会议室持久性库“创建触发器

CREATE TRIGGER  IF NOT EXISTS delete_till_10 INSERT ON user WHEN (select count(*) from user)>9

BEGIN 

    DELETE FROM user WHERE id IN  (SELECT id FROM user ORDER BY id limit (select count(*) -9 from user));

END

0 个答案:

没有答案