使用公式时如何引用另一个表中的变量?
我建了orders表,在orders表中的ordersum列我想使用公式,为goods表中的price字段与本表中的quantity的乘积.可是当我通过设计表打开写入公式时提示错误,我用的公式为goods.price*quantity我创建的orders表如下
create table orders
(
orderID int
constraint pk_orderID primary key,
goodsname varchar(20)
not null
references goods(name)
on delete cascade,
customerID int
not null
foreign key(customerID) references customers(customerID)
on delete no action,
quantity int
not null
constraint ck_quantity check(quantity>0),
ordersum money not null,
orderdate datetime
default (getdate())
)
请教一下应怎样才能用另一个表中的变量作为公式啊