我有一个这样的 oracle 表:
create table tms_transaction_tbl
(
trans_id number primary key,
location_id number,
trans_date date,
resource_id number,
ts_id number,
max_value number,
booked_units number default 0,
remaining number default (select max_value-booked_units),
booked number not null ,
user_id number,
trans_time timestamp
);
如您所见,我尝试将剩余的默认值设置为 (max_value-booked_units)
remainging number default (select max_value-booked_units),
但它给了我这个错误这个错误
ora-22818:subquery expression not allowed here