Question

Whats wrong with my query?

 ALTER TABLE test_posts ADD sticky boolean NOT NULL default = false 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=false' at line 2

Was it helpful?

Solution

You need to remove the =:

ALTER TABLE test_posts ADD sticky boolean NOT NULL default false 

OTHER TIPS

This SQL command should work:

ALTER TABLE test_posts ADD sticky bit NOT NULL default 'false'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top