Create table new_table as
SELECT * FROM customers
LEFT JOIN orders ON customers.idcustomers = orders.idorders
UNION
SELECT * FROM customers
RIGHT JOIN orders ON customers.idcustomers = orders.idorders;
Syntex: select * into new_table_name
From table1 as t1
Join table2 as t2 ON t2.column name =
t1.column name;
Example: select * into emp_detls
From employee as emp
Join employeeDOB AS edob ON edob.employeeID
= emp.e_id
4条答案
按热度按时间44u64gxh1#
是的,你可以像下面这样使用
CREATE TABLE AS ... SELECT FROM
结构;考虑到new_table
并不存在编辑:
根据最新的评论,使用表别名来解决这个问题
mepcadol2#
您可以使用
新建表new_table
juzqafwq3#
此查询将连接两个表并使用这两个连接的表创建新表
8yparm6h4#
或