删除所有数据:(注意请求方式是Post,只删除数据,不删除表结构)
ES删除全部数据的方法(Delete By Query)
https://blog.csdn.net/weixin_39198406/article/details/83016471
ElasticSearch 清空index数据的方法
https://www.cxyzjd.com/article/DPnice/80251696
ElasticSearch 定时批量删除N天前的数据
https://blog.csdn.net/geekswg/article/details/107097322
ElasticSearch 清空index数据的方法 _delete_by_query
https://blog.csdn.net/DPnice/article/details/80251696
Document APIs » Delete by query API
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
首先,你的表肯定是做了外键等约束的,所以删除,要从最外层删除。假设你的数据库是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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)