Value must be from another table : Check « Table Index « SQL / MySQL






Value must be from another table

        
mysql>
mysql> CREATE   TABLE EmployeeS_V
    ->         (EmployeeNO   SMALLINT NOT NULL,
    ->          SEX        CHAR(1) NOT NULL
    ->                     CHECK(SEX IN
    ->                        (SELECT SEX FROM EmployeeS)));
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> drop table Employees_v;
Query OK, 0 rows affected (0.00 sec)

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Check date range
2.Using regular expression in check