日期:2014-05-17 浏览次数:20467 次
----------------------------------------------------------------
-- Author :DBA_Huangzj(發糞塗牆)
-- Date :2013-11-27 08:12:33
-- Version:
-- Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)
-- Dec 28 2012 20:23:12
-- Copyright (c) Microsoft Corporation
-- Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )
--
----------------------------------------------------------------
--> 测试数据:[a]
if object_id('[a]') is not null drop table [a]
go
create table [a]([sno] int,[sco] int)
insert [a]
select 1,20 union all
select 2,30 union all
select 3,35 union all
select 4,49
--> 测试数据:[b]
if object_id('[b]') is not null drop table [b]
go
create table [b]([sno] int,[sco] int)
insert [b]
select 1,11 union all
select 2,22 union all
select 3,33 union all
select 4,31
--> 测试数据:[c]
if object_id('[c]') is not null drop table [c]
go
create table [c]([sno] int,[sco] int)
insert [c]
select 1,120 union all
select 2,130 union all
select 3,135 union all
select 4,149
--------------开始查询---