@ECHO OFF
:Loop
IF "%1"=="" GOTO completed
FOR %%F IN (%1) DO IF "%%F"%3==0 echo %%F
SHIFT
GOTO Loop
:completed
我编写此代码用于在Windows中使用批处理脚本检查数组中的数据。 在cmd上运行此.bat文件
但是可以被3整除的值
答案 0 :(得分:3)
你有几个问题。首先,您不需要;with
cte_qry1 as (
select distinct sysnam,count(*) as High from tablename
where Label00002 = '1.High' and Item_grade = 'NON-COMPLIANT'
group by sysnam
)
cte_qry2 as (
select distinct sysnam,count(*) as Medium from tablename
where Label00002 = '2.Medium' and Item_grade = 'NON-COMPLIANT'
group by sysnam
)
select cte_qry1.sysnam, High, Medium
from cte_qry1
inner join cte_qry2
on cte_qry1.sysnam = cte_qry2.sysnam
循环和for
循环来循环遍历脚本参数。选一个。接下来,goto
语句无法执行数学运算。他们无法计算模数。您必须使用if
来计算模数(num%3)。
这是一个有效的例子。
set /a