CHECK constraint in MySQL is not working

后端 未结 8 2035
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

    Update to MySQL 8.0.16 to use checks:

    As of MySQL 8.0.16, CREATE TABLE permits the core features of table and column CHECK constraints, for all storage engines. CREATE TABLE permits the following CHECK constraint syntax, for both table constraints and column constraints

    MySQL Checks Documentation

提交回复
热议问题