首页 > 数据库技术 > 详细

mysql 3813:Column check constraint 'tb_course_chk_3' references other column.

时间:2020-12-26 17:54:23      阅读:399      评论:0      收藏:0      [点我收藏+]
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是另一个列,该列被引用

 

mysql 3813:Column check constraint 'tb_course_chk_3' references other column.

原文:https://www.cnblogs.com/xing-29391/p/14192558.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!