【发布时间】:2015-06-20 07:56:41
【问题描述】:
我正在尝试将包含列乘法的子查询的值插入到表中。这很好用,但是如果我查询表,它只有 0 个值。有人知道为什么吗?
我的查询是:
create table user_payments
(payment_stream number(4));
insert into user_payments (payment_stream)
select ct.min_price*s.stream_min as payment_stream
from users u
, streaming s
, content_type ct
, contract c
, media_content mc
where u.user_ID = s.user_ID
and mc.media_content_ID = s.media_content_ID
and ct.content_type_ID = mc.content_type_ID
and u.user_ID = c.user_ID
and c.contract_name = 'Pay as you go';
如果我单独查询 select 查询,我会得到预期的结果,但是,一旦将行插入到表中,所有值都是 0。
感谢您的帮助!
【问题讨论】: