我正在使用SQL Server 2008 R2。如何获得提供的输出?
tbl_Configure
Date Name
1/1/13 Sandeep
1/2/13 Sudeep
tbl_Install
Date Name
1/1/13 Sandeep
1/2/13 Sandeep
输出:
Date Name Type
1/1/13 Sandeep Configure
1/1/13 Sandeep Install
1/2/13 Sudeep Configure
1/2/13 Sandeep Install
答案 0 :(得分:3)
Select config.Date, config.Name, 'Configure' as Type From tbl_Configure config
Union
Select install.Date, install.Name, 'Install' as Type From tbl_Install install