数据库中删除数据,es会删除对应的索引
1个回答
2015-06-02
展开全部
首先,你的表肯定是做了外键等约束的,所以删除,要从最外层删除。假设你的数据库是Sql Server的。
1、技能表
delete from 技能表 where 人物id in (select 人物id from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3))
2、装备属性表
delete from 装备属性表 where 装备id in (select 装备id from 装备表 where 人物id in (select 人物id from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3)))
3、装备表
delete from 装备表 where 人物id in (select 人物id from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3))
4、人物表
delete from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3)
5、账号表
delete from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3
1、技能表
delete from 技能表 where 人物id in (select 人物id from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3))
2、装备属性表
delete from 装备属性表 where 装备id in (select 装备id from 装备表 where 人物id in (select 人物id from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3)))
3、装备表
delete from 装备表 where 人物id in (select 人物id from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3))
4、人物表
delete from 人物表 where 账号id in (select 账号id from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3)
5、账号表
delete from 账号表 where datediff(day,上次登录时间lasttime,getdate())>=3
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询