> We have a table (170K rows) and we altered the colum 'created_date' to not
> null with default value to '1900-01-01 00:00:00' , after the alter column
> statement is complited we select for the same column for nulls and I found
> 13K rows with null value
>    select * from table1 where creted_date is null
> Run again an update for that column with the default date and it did not
> work too.

Setting a default value for a column will NOT update any values of records
already in the database.  However a simple

UPDATE table1 SET created_date = '1900-01-01 00:00:00' WHERE created_date IS
NULL

should update the records so they are set the way you want.

Sincerely,

Craig Vincent


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to