22,294
社区成员
发帖
与我相关
我的任务
分享
但是的确是 把两个表中的这三个字段查询出来,字段哦
呵呵
select * into newtable2 from
(
select id as aid,AName as Name,A类别 as [类型] from A union all
select id as bid,BName,B类别 from B
)x
select * from newtable2
[/quote]
那现在您这个新表长有几个字段?[/quote]
你试试就知道
但是的确是 把两个表中的这三个字段查询出来,字段哦
呵呵
select * into newtable2 from
(
select id as aid,AName as Name,A类别 as [类型] from A union all
select id as bid,BName,B类别 from B
)x
[/quote]
那现在您这个新表长有几个字段?
但是的确是 把两个表中的这三个字段查询出来,字段哦
呵呵
select * into newtable2 from
(
select id as aid,AName as Name,A类别 as [类型] from A union all
select id as bid,BName,B类别 from B
)x
select aid,AName,A类别 from A union all select bid,BName,B类别 from B
--创建视图
create view view_tablename
as
select a.id as aid,b.id as bid,AName,BName,[A类别],[B类别]
from a inner join b on a.id = b.id
--放在新表中
select a.id as aid,b.id as bid,AName,BName,[A类别],[B类别]
into newtable1 from a inner join b on a.id = b.id
求解 大神