Paer Toernell
asked on
Change a boolean column to default False
To add a boolean column with the default value "False" works:
But to change it when its already created?
ALTER TABLE `platsonline`.`attribut_lists`
ADD COLUMN `B_TEST3` BOOLEAN DEFAULT TRUE NULL
But to change it when its already created?
BOOLEAN fields are synonomous with tinyint(1). Just set it to 0 or 1.
ASKER
I seen all these examples, when i run them in MysqlYog they dont work. I need working code.
UPDATE platsonline SET B_Test3=0
will set the field to FALSE.
UPDATE platsonline SET B_Test3=1
will set the field to TRUE.
will set the field to FALSE.
UPDATE platsonline SET B_Test3=1
will set the field to TRUE.
(Don't forget to add a WHERE clause to set just one row, otherwise these mysql statements will set every row in the table)
ASKER
Thanx, but that wont do. I want the default value to be automatic set to False.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.