我试图创建一个表custom_table
产品没有价格列,PC 和笔记本电脑都没有类型列。
所以我需要知道如何在这种情况下使用 with 子句创建表?
这是我的查询
with custom_table(model,type,price)
as
(select model,type from product
union
select model,price from pc
union
select model,price from laptop)
select * from custom_table