Search code examples
sqlmysqlalter-table

query " ALTER TABLE test_posts ADD sticky boolean NOT NULL default = false" = error


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


Solution

  • You need to remove the =:

    ALTER TABLE test_posts ADD sticky boolean NOT NULL default false