T-SQL 汇总之五 GOTO语句
/** GOTO语句可以实现无条件跳转 语法格式 GOTO lable 其中lable为要跳转到的语句标号 遇到GOTO语句时直接跳转到lable标签处继续执行,而goto之后的语句不再执行 **/ declare @result int=0 declare @sn int =0 loop_1:--定义标号 set @result=@result+@sn set @sn=@sn+1 if(@sn<=100) goto loop_1--如果小于100就跳转到loop_1标号处 print @result
浙公网安备 33010602011771号