日期:2014-05-17 浏览次数:20518 次
if object_id('Tempdb..#A') is not null drop table #A
if object_id('Tempdb..#B') is not null drop table #B
if object_id('Tempdb..#C') is not null drop table #C
--临时表A
create table #A
(
[AID] int identity(1,1) not null,
[UserName] nvarchar(10) null
)
--临时表B
create table #B
(
[BID] int identity(1,1) not null,
[LevelName] nvarchar(10) null
)
--临时表C
create table #C
(
id int identity(1,1) not null,
[AID] int null,
[BID] int null
)
-----------添加测试数据---------
Insert into #A
select 'a' union all
select 'b'
Insert into #B
select 'aa' union all
select 'bb' union all
select 'aaa' union all
select 'bbbb' union all