0

I have table in MySql database want to limit some column value,

is it possible to make a column in table to take specified value such as (value <= 3) ?

Sermed mayi
  • 697
  • 7
  • 26

1 Answers1

1

you need to use a constraint named check which will be defined on table creation and check the value before insert .

CREATE TABLE table_name (          
    value INT ,
    CHECK(value <= 3)
)
HijenHEK
  • 1,256
  • 1
  • 4
  • 13