sql server 循环
时间:2021-07-01 10:21:17
帮助过:31人阅读
pubs
Go
WHILE (
SELECT AVG(price)
FROM titles)
< $
30
BEGIN
UPDATE titles
SET price
= price
* 2
SELECT MAX(price)
FROM titles
IF (
SELECT MAX(price)
FROM titles)
> $
50
BREAK
ELSE
CONTINUE
END
------------------------------------------------------
设置个变量,就能实现for(i=0;i
<10,i
++)
DECLARE @i int
set @i=0
WHILE @i<10
BEGIN
//语句序列
...
set @i=@i+1
END
使用go
go
select * from AYS_XZ_MEETINGROOM
go 200
sql server 循环
标签:-- ++ rom declare bsp sql class code use