declare @i int begin insert into test (userid) values(@i) end --------------- while 条件 begin 执行操作 end --何问起 hovertree.com WHILE设置重复执行 SQL 语句或语句块的条件.只要指定的条件为真,就重复执行语句.可以使用 BREAK 和 CONTINUE 关键字在循环内部控制 WHILE 循环中语句的执行. 语法WHILE Boolean_expression { s…
VBA基础之循环语句 Sub s1() Dim rg As Range For Each rg In Range("a1:b7,d5:e9") If rg = "" Then rg = 0 End If Next rg End Sub Sub s2() Dim x As Integer Do x = x + 1 If Cells(x + 1, 1) <> Cells(x, 1) + 1 Then Cells(x, 2) = "断点"…
VBS基础篇 - 循环语句(4) - For Each...Next For Each...Next 循环与 For...Next 循环类似.For Each...Next 不是将语句运行指定的次数,而是对于数组中的每个元素或对象集合中的每一项重复一组语句.这在不知道集合中元素的数目时非常有用. 语法结构如下: 1 2 3 4 5 For Each element In group [statements] [Exit For] [statements…