ecshop快速删除顶级分类下的2级及3级分类
用ecshop做的商城系统,由于产品调整,有1个大分类不想要了,下面有几十个小分类.在后台1个个删除真的很慢很麻烦.想在数据库里一次性删除,但又怕出问题,自己写的语话如下...
用ecshop做的商城系统,由于产品调整,有1个大分类不想要了,下面有几十个小分类.在后台1个个删除真的很慢很麻烦.想在数据库里一次性删除,但又怕出问题,自己写的语话如下,希望大神们给点意见.该1级分类的id是2
delete from ecs_category where cat_id in (select cat_id from ecs_category where parent_id in (select cat_id from ecs_category where parent_id = 2) or cat_id in (select cat_id from ecs_category where parent_id = 2) or cat_id = 2) 展开
delete from ecs_category where cat_id in (select cat_id from ecs_category where parent_id in (select cat_id from ecs_category where parent_id = 2) or cat_id in (select cat_id from ecs_category where parent_id = 2) or cat_id = 2) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询