现在同一个数据库中有2个表:
--> tableA(col1,col2,col3)
--> tableB(col1,col2,col3)
col1是对应的键我要实现的结果是tableA.col3 = tableB.col2*tableB.col3. .................................................请问各位大侠,用字段的公式能实现吗?公式要怎么写?
这里:
不用触发器哦数据库
--> tableA(col1,col2,col3)
--> tableB(col1,col2,col3)
col1是对应的键我要实现的结果是tableA.col3 = tableB.col2*tableB.col3. .................................................请问各位大侠,用字段的公式能实现吗?公式要怎么写?
这里:
不用触发器哦数据库
然后再建立规范式:
tableA.col1=tableB.col1
and tableA.col3 = tableB.col2*tableB.col3
参考 http://msdn.microsoft.com/zh-cn/library/ms191250(v=sql.105).aspx
--> 计算列由可以使用同一表中的其他列的表达式计算得来.此需求可以用触发器实现即可.