Select * INTO ALLCommuteOD from (SELECT * FROM [ICData].[dbo].[CommuteOD1]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD2]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD3]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD4]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD5]
)
6 个解决方案
#1
报什么错?检查一下表结构,字段类型等是否完全一致
#2
报的什么错。
#3
表结构一致,报错')'附近有错误
#4
这样写
SELECT *
INTO ALLCommuteOD
FROM ( SELECT *
FROM [ICData].[dbo].[CommuteOD1]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD2]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD3]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD4]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD5]
) t
#5
后面要加个别名吧
Select * INTO ALLCommuteOD from (SELECT * FROM [ICData].[dbo].[CommuteOD1]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD2]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD3]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD4]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD5]
) a
Select * INTO ALLCommuteOD from (SELECT * FROM [ICData].[dbo].[CommuteOD1]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD2]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD3]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD4]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD5]
) a
#6
加表别名。。。
#1
报什么错?检查一下表结构,字段类型等是否完全一致
#2
报的什么错。
#3
表结构一致,报错')'附近有错误
#4
这样写
SELECT *
INTO ALLCommuteOD
FROM ( SELECT *
FROM [ICData].[dbo].[CommuteOD1]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD2]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD3]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD4]
UNION ALL
SELECT *
FROM [ICData].[dbo].[CommuteOD5]
) t
#5
后面要加个别名吧
Select * INTO ALLCommuteOD from (SELECT * FROM [ICData].[dbo].[CommuteOD1]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD2]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD3]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD4]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD5]
) a
Select * INTO ALLCommuteOD from (SELECT * FROM [ICData].[dbo].[CommuteOD1]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD2]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD3]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD4]
UNION ALL SELECT * FROM [ICData].[dbo].[CommuteOD5]
) a
#6
加表别名。。。