CHECK constraint in MySQL is not working

后端 未结 8 2050
Happy的楠姐
Happy的楠姐 2020-11-21 05:15

First I created a table like

CREATE TABLE Customer (
  SD integer CHECK (SD > 0),
  Last_Name varchar (30),
  First_Name varchar(30)
);

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 05:48

    try with set sql_mode = 'STRICT_TRANS_TABLES' OR SET sql_mode='STRICT_ALL_TABLES'

提交回复
热议问题