此派生属性查询正确吗?

时间:2019-05-14 15:33:13

标签: sql

我想通过将预订数量乘以预订表中的人数来从预订表和套餐表中计算出金额。

create table Booking (book_id int primary key, 
cust_id int, foreign key(cust_id) references Customer(cust_id),
agent_id int, foreign key(agent_id) references Agent(agent_id),
pkg_id int, foreign key(pkg_id) references Package(pkg_id),
trp_id int, foreign key(trp_id) references Transport(trp_id),
destintion varchar(3), foreign key(destination) references City(city_code),
source varchar(3), foreign key(source) references City(city_code),
dept_day Date,
arrvl_day Date,
no_ofPpl int,
paym_status varchar(10),
amount int as (Booking.no_ofPpl * (select amount from Package where Package.pkg_id = Booking.pkg_id)));

amount int as (Booking.no_ofPpl * (select amount from Package where Package.pkg_id = Booking.pkg_id)));
           *
  

第12行出现错误:ORA-54016:指定了无效的列表达式

(无法解决错误)

0 个答案:

没有答案