插入另一张表统计后的数据,(把统计好的sum插入另一张表的all_q)
select sum(quantity)into booksta
from orderBook
where bookID in(select bookID from bookstas)
group by bookID;
缺少对象或列名,或者对象或列名为空。对于 SELECT INTO 语句,请确保每列均具有名称。对于其他语句,请查找空的别名。不允许使用定义为 "" 或 [] 的别名。请将别名更改为有效名称。
select sum(quantity)into all_q from bookstas
from orderBook
where bookID in(select bookID from bookstas)
group by bookID;
成功插入