zoukankan      html  css  js  c++  java
  • mysql 3813:Column check constraint 'tb_course_chk_3' references other column.

    alter table tb_course add selected int(3) not null default 0  check ( selected between 0 and total_people ) comment '课程已选人数';

    报错:Column check constraint 'tb_course_chk_3' references other column. 列检查约束不能引用其他列

    alter table tb_course add selected int(3) not null default 0 comment '课程已选人数';
    alter table tb_course add constraint ck_selected check ( tb_course.selected between 0 and tb_course.total_people); #total_people是另一个列,该列被引用
  • 相关阅读:
    UVA
    codeforces #371div2 B
    POJ-3278 Catch That Cow
    巴士博弈
    权势二进制
    HDU
    SQL 函数
    SQL 查询语句×45
    SQL 触发器
    SQL 连接查询
  • 原文地址:https://www.cnblogs.com/xing-29391/p/14192558.html
Copyright © 2011-2022 走看看