双色球缩水的sql语句

无聊的时候写的,参考阿良的一篇22选5的

 

-- 从网站下载七位号码存为aa.txt 以tab分隔字段,导入到sql2000中字段为col001, ..col007.
-- 导入文本文件到数据库中,表名为aa
alter table aa
add
acvalue int, -- ac值
jsgs int,    -- 奇数个数
osgs int,    -- 偶数个数
top6 int,    -- 本期号码出现在前六期中的个数
twtz int,    -- 本期号码与上期号码同位同值
lh int,      -- 连号
sumvalue int,-- 和值
kdvalue int, -- 跨度值 第六位与第一位的差值
b11 int,     -- col1-col6出现在01-11区间的个数
b22 int,     -- col1-col6出现在12-22区间的个数
b33 int      -- col1-col6出现在23-33区间的个数

 

-- 构建辅助表
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T1]'))
drop table [dbo].[T1]
GO
create table T1(R1 varchar(10))
Go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T2]'))
drop table [dbo].[T2]
GO
create table T2(R2 varchar(10))
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T3]'))
drop table [dbo].[T3]
GO
create table T3(R3 varchar(10))
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T4]'))
drop table [dbo].[T4]
GO
create table T4(R4 varchar(10))
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T5]'))
drop table [dbo].[T5]
GO
create table T5(R5 varchar(10))
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T6]'))
drop table [dbo].[T6]
GO
create table T6(R6 varchar(10))
GO
/*** 组合数据 置入辅助数据 ***/
--R1
declare @i int
set @i=1
A:
begin
    insert into T1 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=28 goto A
select * from T1
GO

--R2
declare @i int
set @i=2
A:
begin
    insert into T2 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=29 goto A
select * from T2
GO

--R3
declare @i int
set @i=3
A:
begin
    insert into T3 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=30 goto A
select * from T3
GO

--R4
declare @i int
set @i=4
A:
begin
    insert into T4 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=31 goto A
select * from T4
GO

--R5
declare @i int
set @i=5
A:
begin
    insert into T5 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=32 goto A
select * from T5
GO

--R6
declare @i int
set @i=6
A:
begin
    insert into T6 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=33 goto A
select * from T6
GO
/************************************/
select * into T from T1,T2,T3,T4,T5,T6
where
R1<R2 and R1<R3 and R1<R4 and R1<R5 and R1<R6 and
R2<R3 and R2<R4 and R2<R5 and R2<R6 and
R3<R4 and R3<R5 and R3<R6 and
R4<R5 and R4<R6 and
R5<R6

 

select identity(int,1,1) as id,* into #tt from
(
/*
select
'01' as Col001,
'02' as Col002,
'03' as Col003,
'04' as Col004,
'05' as Col005,
'06' as Col006
union all
*/
select
Col001,Col002,Col003,Col004,Col005,Col006
from aa
) as newaa

-- 计算AC列
ALTER TABLE #tt ADD acvalue INT
GO
update #tt set  acvalue =
(select count(*) from
(
select right('0'+Cast(Cast(Col006 as int)-Cast(Col005 as int) as varchar(10)),2) as a union
select right('0'+Cast(Cast(Col006 as int)-Cast(Col004 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col006 as int)-Cast(Col003 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col006 as int)-Cast(Col002 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col006 as int)-Cast(Col001 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col005 as int)-Cast(Col004 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col005 as int)-Cast(Col003 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col005 as int)-Cast(Col002 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col005 as int)-Cast(Col001 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col004 as int)-Cast(Col003 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col004 as int)-Cast(Col002 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col004 as int)-Cast(Col001 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col003 as int)-Cast(Col002 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col003 as int)-Cast(Col001 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(Col002 as int)-Cast(Col001 as int) as varchar(10)),2)
)  AS T)-5

-- 计算AC列结束

-- 计算连号个数
ALTER TABLE #tt ADD lh INT
GO
UPDATE #tt SET lh =
CASE WHEN cast (col002 as int) - cast (col001 as int)=1 THEN 1 ELSE 0 END +
CASE WHEN cast (col003 as int) - cast (col002 as int)=1 THEN 1 ELSE 0 END +
CASE WHEN cast (col004 as int) - cast (col003 as int)=1 THEN 1 ELSE 0 END +
CASE WHEN cast (col005 as int) - cast (col004 as int)=1 THEN 1 ELSE 0 END +
CASE WHEN cast (col006 as int) - cast (col005 as int)=1 THEN 1 ELSE 0 END
-- 计算连号个数 结束

-- 计算和值
ALTER TABLE #tt ADD sumvalue INT
GO
UPDATE #tt SET sumvalue =
cast(col001 as int) +
cast(col002 as int) +
cast(col003 as int) +
cast(col004 as int) +
cast(col005 as int) +
cast(col006 as int)
-- 计算连号个数 结束

-- 计算跨度值
ALTER TABLE #tt ADD kdvalue INT
GO
UPDATE #tt SET kdvalue =
cast(col006 as int) - cast(col001 as int)
-- 计算跨度值

-- 计算奇数个数
ALTER TABLE #tt ADD jsgs INT
GO
UPDATE #tt SET jsgs=Col001%2+Col002%2+Col003%2+Col004%2+Col005%2+Col006%2
-- 计算奇数个数结束

-- 计算偶数个数
ALTER TABLE #tt ADD osgs INT
GO
UPDATE #tt SET osgs=6-(Col001%2+Col002%2+Col003%2+Col004%2+Col005%2+Col006%2)
-- 计算偶数个数结束

-- 上六期出现的个数
ALTER TABLE #tt ADD top6 INT
GO
update #tt set top6 =
case when col001 in
(
select top 6 col001 from #tt as b where b.id>#tt.id union
select top 6 col002 from #tt as b where b.id>#tt.id union
select top 6 col003 from #tt as b where b.id>#tt.id union
select top 6 col004 from #tt as b where b.id>#tt.id union
select top 6 col005 from #tt as b where b.id>#tt.id union
select top 6 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col002 in
(
select top 6 col001 from #tt as b where b.id>#tt.id union
select top 6 col002 from #tt as b where b.id>#tt.id union
select top 6 col003 from #tt as b where b.id>#tt.id union
select top 6 col004 from #tt as b where b.id>#tt.id union
select top 6 col005 from #tt as b where b.id>#tt.id union
select top 6 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col003 in
(
select top 6 col001 from #tt as b where b.id>#tt.id union
select top 6 col002 from #tt as b where b.id>#tt.id union
select top 6 col003 from #tt as b where b.id>#tt.id union
select top 6 col004 from #tt as b where b.id>#tt.id union
select top 6 col005 from #tt as b where b.id>#tt.id union
select top 6 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col004 in
(
select top 6 col001 from #tt as b where b.id>#tt.id union
select top 6 col002 from #tt as b where b.id>#tt.id union
select top 6 col003 from #tt as b where b.id>#tt.id union
select top 6 col004 from #tt as b where b.id>#tt.id union
select top 6 col005 from #tt as b where b.id>#tt.id union
select top 6 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col005 in
(
select top 6 col001 from #tt as b where b.id>#tt.id union
select top 6 col002 from #tt as b where b.id>#tt.id union
select top 6 col003 from #tt as b where b.id>#tt.id union
select top 6 col004 from #tt as b where b.id>#tt.id union
select top 6 col005 from #tt as b where b.id>#tt.id union
select top 6 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col006 in
(
select top 6 col001 from #tt as b where b.id>#tt.id union
select top 6 col002 from #tt as b where b.id>#tt.id union
select top 6 col003 from #tt as b where b.id>#tt.id union
select top 6 col004 from #tt as b where b.id>#tt.id union
select top 6 col005 from #tt as b where b.id>#tt.id union
select top 6 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end
-- 上六期出现的个数 结束

-- 上期同位出现同值
ALTER TABLE #tt ADD twtz INT
GO
update #tt set twtz =
case when col001 in
(
select top 1 col001 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col002 in
(
select top 1 col002 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col003 in
(
select top 1 col003 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col004 in
(
select top 1 col004 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col005 in
(
select top 1 col005 from #tt as b where b.id>#tt.id
) then 1 else 0 end +
case when col006 in
(
select top 1 col006 from #tt as b where b.id>#tt.id
) then 1 else 0 end

-- 上期同位出现同值 结束
-- 计算各区间分布
ALTER TABLE #tt ADD b11 INT,b22 INT,b33 INT
GO
update #tt set
b11 =
case when col001<=11 then 1 else 0 end +
case when col002<=11 then 1 else 0 end +
case when col003<=11 then 1 else 0 end +
case when col004<=11 then 1 else 0 end +
case when col005<=11 then 1 else 0 end +
case when col006<=11 then 1 else 0 end
,
b22 =
case when col001 >11 and col001<=22 then 1 else 0 end +
case when col002 >11 and col002<=22 then 1 else 0 end +
case when col003 >11 and col003<=22 then 1 else 0 end +
case when col004 >11 and col004<=22 then 1 else 0 end +
case when col005 >11 and col005<=22 then 1 else 0 end +
case when col006 >11 and col006<=22 then 1 else 0 end
,b33 =
case when col001 >22 and col001<=33 then 1 else 0 end +
case when col002 >22 and col002<=33 then 1 else 0 end +
case when col003 >22 and col003<=33 then 1 else 0 end +
case when col004 >22 and col004<=33 then 1 else 0 end +
case when col005 >22 and col005<=33 then 1 else 0 end +
case when col006 >22 and col006<=33 then 1 else 0 end
-- 计算各区间分布 结束

/*==================================================*/
-- 以下为ac值分析方法
select acvalue,count(1) as vccnt from #tt group by acvalue order by vccnt
-- 以下为连号分析方法
select lh,count(1) as lhcnt from #tt group by lh order by lhcnt
-- 以下为奇数个数分析方法
select jsgs ,count(1) as jscnt from #tt group by jsgs order by jscnt
-- 前六期出现分析
select top6 ,count(1) as tp6cnt from #tt group by top6 order by tp6cnt
-- 同位同值出现分析 [0-3 其中0:500 1:201 2:46 3:9 在此处可以只取01]
select twtz ,count(1) as twtzcnt from #tt group by twtz order by twtzcnt
-- 和值分析 42 - 158
select sumvalue,count(1) as sumcnt from #tt group by sumvalue order by sumcnt
-- 跨度值分析 9 - 32
select kdvalue,count(1) as kdcnt from #tt group by kdvalue order by kdcnt
-- 首位分析 1 - 19
select cast(col001 as int) as col1,count(1) as sumsw from #tt group by col001 order by sumsw
-- 末位分析 14 - 33
select cast(col006 as int) as col6,count(1) as summw from #tt group by col006 order by summw
-- 加入区间分析 分析在 1-11 12-22 23-33出现的情况

/*==================================================*/
truncate table aa
go
insert into aa(col001,col002 ,col003 ,col004 ,col005 ,col006 ,acvalue,jsgs,osgs,top6,twtz,lh,sumvalue,kdvalue)
SELECT col001,col002 ,col003 ,col004 ,col005 ,col006 ,acvalue,jsgs,osgs,top6,twtz,lh,sumvalue,kdvalue FROM #tt
-- 删除临时表
drop table  #tt


-- 缩水开始
select * from T where
--首号:[01-19]
R1>='01'
and R1<='19'
--尾号:[14-33]
and R6 >='14'
and R6 <='33'
--奇数:[0-6]
and (R1%2 + R2%2 + R3%2 + R4%2 + R5%2+ R6%2)>=0
and (R1%2 + R2%2 + R3%2 + R4%2 + R5%2+ R6%2)<=6
--和值:[42-158]
and (Cast(R1 as int) + Cast(R2 as int) + Cast(R3 as int) + Cast(R4 as int) + Cast(R5 as int) + Cast(R6 as int))>=42
and (Cast(R1 as int) + Cast(R2 as int) + Cast(R3 as int) + Cast(R4 as int) + Cast(R5 as int) + Cast(R6 as int))<=158
--连号:[0-4 其中1:320 0:284 2:133 3:18 4:1 此处3与4可不要]
and (Case Cast(R2 as int)-Cast(R1 as int) when 1 then 1 else 0 end)+
(Case Cast(R3 as int)-Cast(R2 as int) when 1 then 1 else 0 end)+
(Case Cast(R4 as int)-Cast(R3 as int) when 1 then 1 else 0 end)+
(Case Cast(R5 as int)-Cast(R4 as int) when 1 then 1 else 0 end)+
(Case Cast(R6 as int)-Cast(R5 as int) when 1 then 1 else 0 end)
 <= 3
and (Case Cast(R2 as int)-Cast(R1 as int) when 1 then 1 else 0 end)+
(Case Cast(R3 as int)-Cast(R2 as int) when 1 then 1 else 0 end)+
(Case Cast(R4 as int)-Cast(R3 as int) when 1 then 1 else 0 end)+
(Case Cast(R5 as int)-Cast(R4 as int) when 1 then 1 else 0 end)+
(Case Cast(R6 as int)-Cast(R5 as int) when 1 then 1 else 0 end)
>= 0
--跨度:[9-32]
-- 可不要或指定其范围
and Cast(R6 as int)-Cast(R1 as int)>=9
and Cast(R6 as int)-Cast(R1 as int)<=32
--重号:[0-3 其中0:500 1:201 2:46 3:9 在此处可以只取0 1]
and
(Case when R1 in
(
select top 1 col001 from aa union
select top 1 col002 from aa union
select top 1 col003 from aa union
select top 1 col004 from aa union
select top 1 col005 from aa union
select top 1 col006 from aa
) then 1 else 0 end)+
(Case when R2 in
(
select top 1 col001 from aa union
select top 1 col002 from aa union
select top 1 col003 from aa union
select top 1 col004 from aa union
select top 1 col005 from aa union
select top 1 col006 from aa
) then 1 else 0 end)+
(Case when R3 in
(
select top 1 col001 from aa union
select top 1 col002 from aa union
select top 1 col003 from aa union
select top 1 col004 from aa union
select top 1 col005 from aa union
select top 1 col006 from aa
) then 1 else 0 end)+
(Case when R4 in
(
select top 1 col001 from aa union
select top 1 col002 from aa union
select top 1 col003 from aa union
select top 1 col004 from aa union
select top 1 col005 from aa union
select top 1 col006 from aa
)
 then 1 else 0 end)+
(Case when R5 in
(
select top 1 col001 from aa union
select top 1 col002 from aa union
select top 1 col003 from aa union
select top 1 col004 from aa union
select top 1 col005 from aa union
select top 1 col006 from aa
)
 then 1 else 0 end)+
(Case when R6 in
(
select top 1 col001 from aa union
select top 1 col002 from aa union
select top 1 col003 from aa union
select top 1 col004 from aa union
select top 1 col005 from aa union
select top 1 col006 from aa
)
 then 1 else 0 end)
<=6
--在前六期出现的个数[0-6 其中 0:1 1:6 2:32 6:74 3:159 5:229 4:255]
and (
Case when r1 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r2 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r3 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r4 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r5 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r6 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)<=5
and (
Case when r1 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r2 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r3 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r4 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r5 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)+
(
Case when r6 in
(
select top 6 col001 from aa union
select top 6 col002 from aa union
select top 6 col003 from aa union
select top 6 col004 from aa union
select top 6 col005 from aa union
select top 6 col006 from aa
) then 1 else 0 end
)>=0
-- 同位同值判断 [0-3 其中0:500 1:201 2:46 3:9 在此处可以只取01]
and
(
case when R1 = (select top 1 col001 from aa) then 1 else 0 end +
case when R2 = (select top 1 col002 from aa) then 1 else 0 end +
case when R3 = (select top 1 col003 from aa) then 1 else 0 end +
case when R4 = (select top 1 col004 from aa) then 1 else 0 end +
case when R5 = (select top 1 col005 from aa) then 1 else 0 end +
case when R6 = (select top 1 col006 from aa) then 1 else 0 end
)>=0
and
(
case when R1 = (select top 1 col001 from aa) then 1 else 0 end +
case when R2 = (select top 1 col002 from aa) then 1 else 0 end +
case when R3 = (select top 1 col003 from aa) then 1 else 0 end +
case when R4 = (select top 1 col004 from aa) then 1 else 0 end +
case when R5 = (select top 1 col005 from aa) then 1 else 0 end +
case when R6 = (select top 1 col006 from aa) then 1 else 0 end
)<=2
-- 区段分布分析 0-11 12-22 23-33
and
case when R1<=11 then 1 else 0 end +
case when R2<=11 then 1 else 0 end +
case when R3<=11 then 1 else 0 end +
case when R4<=11 then 1 else 0 end +
case when R5<=11 then 1 else 0 end +
case when R6<=11 then 1 else 0 end
=2
and
case when R1 >11 and R1<=22 then 1 else 0 end +
case when R2 >11 and R2<=22 then 1 else 0 end +
case when R3 >11 and R3<=22 then 1 else 0 end +
case when R4 >11 and R4<=22 then 1 else 0 end +
case when R5 >11 and R5<=22 then 1 else 0 end +
case when R6 >11 and R6<=22 then 1 else 0 end
=2
--AC值:[2-10 其中2:2 3:3 4:20 5:50 10:67 9:115 6:132 7:154 8:213]

and (select count(*) from
(
select right('0'+Cast(Cast(R6 as int)-Cast(R5 as int) as varchar(10)),2) as a union
select right('0'+Cast(Cast(R6 as int)-Cast(R4 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R6 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R6 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R6 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R4 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R3 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R3 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R2 as int)-Cast(R1 as int) as varchar(10)),2)
) A
)-5 <= 9
and (select count(*) from
(
select right('0'+Cast(Cast(R6 as int)-Cast(R5 as int) as varchar(10)),2) as a union
select right('0'+Cast(Cast(R6 as int)-Cast(R4 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R6 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R6 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R6 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R4 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R3 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R3 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R2 as int)-Cast(R1 as int) as varchar(10)),2)
) A
)-5 >= 6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值