随机分组条件语句for (1..1000){open AOUT,">a$_.txt" || die "Can't open the file:";open BOUT,">b$_.txt" || die "Can't open the file:";open IN,"
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/06 21:13:31
![随机分组条件语句for (1..1000){open AOUT,](/uploads/image/z/13104098-26-8.jpg?t=%E9%9A%8F%E6%9C%BA%E5%88%86%E7%BB%84%E6%9D%A1%E4%BB%B6%E8%AF%AD%E5%8F%A5for+%281..1000%29%7Bopen+AOUT%2C%22%3Ea%24_.txt%22+%7C%7C+die+%22Can%27t+open+the+file%3A%22%3Bopen+BOUT%2C%22%3Eb%24_.txt%22+%7C%7C+die+%22Can%27t+open+the+file%3A%22%3Bopen+IN%2C%22)
随机分组条件语句for (1..1000){open AOUT,">a$_.txt" || die "Can't open the file:";open BOUT,">b$_.txt" || die "Can't open the file:";open IN,"
随机分组条件语句
for (1..1000){
open AOUT,">a$_.txt" || die "Can't open the file:";
open BOUT,">b$_.txt" || die "Can't open the file:";
open IN,"
随机分组条件语句for (1..1000){open AOUT,">a$_.txt" || die "Can't open the file:";open BOUT,">b$_.txt" || die "Can't open the file:";open IN,"
新建一个找到第N个字串起始位置的函数charindexN
create function dbo.charindexN (@indexStr varchar(100)='',--要查找的子串
@str varchar(2000)='',--字符串
@n int=null) --从第n个子串开始查
returns int
begin
declare @tmp varchar(2000) --
declare @m int
declare @i int
set @tmp=@str
set @i=1
set @m=0
while charindex(@indexStr,@tmp)>0 and @i<=@n
begin
set @m=@m+charindex(@indexStr,@tmp)
set @tmp=substring(@tmp,@m+len(@indexStr),len(@tmp))
set @i=@i+1
end
if @i-1<>@n set @m=0
return @m
end
select substring(a.xsgg,1,dbo.charindexN('*',a.xsgg,1)-1) xsgg,count(*) num from T1 a
group by substring(a.xsgg,1,dbo.charindexN('*',a.xsgg,1)-1)
order by count(*) desc;
select substring(a.xsgg,1,dbo.charindexN('*',a.xsgg,2)-1) xsgg,count(a.xsgg) num from T1 a
group by substring(a.xsgg,1,dbo.charindexN('*',a.xsgg,2)-1)
order by count(a.xsgg) desc;
create table T1
( xsgg nvarchar(25),num int)
insert into T1(xsgg,num)
select '20*2000*11500',1 union
select '0.25*1500*2000',1 union
select '20*1500*9000',1 union
select '20*2000*8000',1
你先设置我最佳答案后,我百度Hii教你.