0

I want to create a table where a column can't contain the value 0 have tried many times but its not working why?

The queries i have tried:

create tale t_name(a int(11) not null check(a<>0));

this query is ok but the column a is still taking the value 0 why?

Hex
  • 135
  • 2
  • 11

1 Answers1

0

It seems that though MYSQL accepts CHECK clause in create table, but it silently ignores CHECK clause. Check the link MySQL trigger for workaround.

Gaurav
  • 1,031
  • 8
  • 11