简体   繁体   中英

Change field default in phpmyadmin

Hi so i created a date type field in phpmyadmin and forgot to set its default to NULL, so i returned and edited the default to null my question is how to change the data in the fields affected from the creation of the field? In other words all data in the field is currently '0000-00-00' so i want to change this to NULL. I know i'm supposed to submit some code but nothing comes to mind since I'm just starting to learn SQL.

Try update command resource ,

UPDATE table_name
SET column_name = NULL
WHERE column_name = '0000-00-00'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM