根据check约束条件自动插入数据?
现有表M
拥有ABC三个字段
给C加check约束
让C的值=A/B
当AB插入数据时
c自动插入
例如:
A B C
6 3 2
完全忘记了如何自动插入。。。。
谢谢
[解决办法]
随手敲的,难免手误
- SQL code
create table tb(a int,b int,c as a/b)
[解决办法]
上正解
[解决办法]
create table tb(a int,b int,c as a/b)
---------
同意