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 | selecttable_schema, table_name, column_name |  
			
				
					
						| 2 |   frominformation_schema.columns |  
			
				
					
						| 3 |   wherecolumn_name = 'products_id' |  
			
				
					
						| 4 |     andtable_schema = 'your-db-name' |  
	2. 找到要删除的products_id。 
	
		
			
				
					
						| 1 | createtable_products_id_del |  
			
				
					
						| 3 | selectpd.products_id, pd.products_name |  
			
				
					
						| 4 |   fromproducts_description pd |  
			
				
					
						| 5 |           innerjoinproducts_to_categories pc |  
			
				
					
						| 6 |     onpd.products_id = pc.products_id |  
			
				
					
						| 7 |  wherepc.categories_id in(...) |  
			
				
					
						| 8 |    andpd.products_name like'% | %'; |  
	3. delete 之。 
	
	
		
			
				
					
						| 01 | deletefromproducts_to_categories whereproducts_id in(); |  
			
				
					
						| 02 | deletefromproducts whereproducts_id in(); |  
			
				
					
						| 03 | deletefromproducts_description whereproducts_id in(); |  
			
				
					
						| 05 | deletefromproducts_attributes .. |  
			
				
					
						| 06 | deletefromproducts_discount_quantity .. |  
			
				
					
						| 07 | deletefromproducts_notifications .. |  
			
				
					
						| 08 | deletefromproducts_with_attributes_stock .. |  (责任编辑:最模板)
 | 
			
			 
			
			
			
			
			
			
			
			
				------分隔线----------------------------