--try
create table t(id varchar(20))
insert into t select '2000601063355487'
insert into t select '2000601061122211'
insert into t select '2000601061345566'
insert into t select '2000601060122344'
go
create function f_s(@id varchar(20))
returns int
as
begin
declare @n int,@r int
set @r=0
set @n=1
while @n<=len(@id)-3
begin
if convert(int,substring(@id,@n,2))%11=0 and convert(int,substring(@id,@n+2,2))%11=0
begin
set @r=@r+1
set @n=@n+1
end
else
set @n=@n+1
end
return @r
end
go
delete t where dbo.f_s(id)>=1
select * from t
/*結果*/
id
--------------------
2000601060122344
create table #(code varchar(100),code1 varchar(100))
insert into #(code)
select '2000601063355487'
union all select '2000601061122211'
union all select '2000601061345566'
union all select '2000601061123368'
union all select '2123601061234567'
update #
set code1 = replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(code,'00','**'),'11','**'),'22','**'),'33','**'),'44','**'),'55','**'),'66','**'),'77','**'),'88','**'),'99','**')
select code from # where charindex('****',code1)>0
create table #(code varchar(100))
insert into #(code)
select 'abc1122&#*'
union all select '78351133#%DJ'
union all select 'DFsdfsdf2233'
union all select 'UIUWEIUNIDFE'
delete from # where code like '%[00-99]%'
drop table #