假定数据库字段为
id,name,color,kc,ch
select id,name,color,kc,ch,kc-ch as jc from table order by id 即可.
在T-Sql中可以直接进行运算操作。如:
select jc=kc-ch from table where id='3'
update table1 set jc=kc-ch
执行这个 就行了
可用触发器
or
计算列
如新增列jc:
alter table t add jc as kc-ck
SQL Server数据中运算符与表达式