Zen Cart删除产品Sql
时间:2016-04-24 07:40来源: 作者: 点击:次
Zen Cart首先备份整个数据库是个好习惯。 1.查找包含有products_id字段的数据表。 1 select table_schema, table_name, column_name 2 from information_schema.columns 3 where column_name = products_id 4 and table_schema =
Zen Cart首先备份整个数据库是个好习惯。
1.查找包含有products_id字段的数据表。
1 |
select table_schema, table_name, column_name |
2 |
from information_schema.columns |
3 |
where column_name = 'products_id' |
4 |
and table_schema = 'your-db-name' |
2. 找到要删除的products_id。
1 |
create table _products_id_del |
3 |
select pd.products_id, pd.products_name |
4 |
from products_description pd |
5 |
inner join products_to_categories pc |
6 |
on pd.products_id = pc.products_id |
7 |
where pc.categories_id in (...) |
8 |
and pd.products_name like '% | %' ; |
3. delete 之。
01 |
delete from products_to_categories where products_id in (); |
02 |
delete from products where products_id in (); |
03 |
delete from products_description where products_id in (); |
05 |
delete from products_attributes .. |
06 |
delete from products_discount_quantity .. |
07 |
delete from products_notifications .. |
08 |
delete from products_with_attributes_stock .. |
(责任编辑:最模板) |
------分隔线----------------------------