我需要使用CTAS (Create Table As Select)
创建一个名为Au_Books_ZL
其中包含au_id, fname, lname, title_id, title, Pub_id, price and revenue (which is price*sales)
.
我在线浏览了其他问题,但它们没有显示如何在查询中包含所有属性(lname、fname、title_id 等)。我如何编写 CTAS 来创建新表?
创建表的语法类似于
CREATE TABLE au_books_zl
AS
SELECT au_id,
fname,
lname,
title_id,
title,
pub_id,
price,
price * sales as revenue
FROM <<whatever tables you need to select from>>
WHERE <<whatever conditions you need to apply>>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)