急请高手解决:在SQL中如何有效的将三个表,合成一个视图。
内容:
A表: b表: c表
a1 b1 c1 a1 b1 d1 a1 b1 e1
1 2 3 1 2 4 1 2 5
结果:(视图)
显示内容为 D表:
F1 F2 F3
1 2 3
1 2 4
1 2 5
语法怎样写?能不能实现??
请高手们帮帮忙;无限感激。
------解决方案--------------------create view D
as
select a1 as F1,b1 as F2,c1 as F3 from A
union all
select * from B
union all
select * from C
go
------解决方案--------------------那修改下
Create View D
As
Select a1 As F1, a2 As F2, a3 As F3 From A
Union All
Select * From B
Union All
Select * From C
GO