网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   MySQL (https://www.0058.net/forumdisplay.php?f=76)
-   -   I need to delete all data in a single field from 300 tables (https://www.0058.net/showthread.php?t=5378)

Kaibito 2015-12-19 10:50 PM

I need to delete all data in a single field from 300 tables
 
I have an ecommerce store that I am currently working on and there are approx 300 products which have a field named "product_id" at www.prescription-glasses.com database.

These fields contains an old product_id that I need to delete altogether.

How can I create a query that will replace all "product_id" fields with data in them with a null value?

Lakeville 2015-12-19 10:53 PM

This will set every product_id to NULL which is currently not null.
Code:

UPDATE table_name
SET product_id= NULL
WHERE product_id is not null;



All times are GMT +8. The time now is 03:26 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.