oracle的循环语句怎么写( 二 )


end pro_test_cursor; 。
7. SQL 语句简单的循环怎么写啊 **************
修改了一下:
**************
declare @month_tmp varchar(2);
declare @day_tmp varchar(2);
set @month_tmp = '1';
set @day_tmp = '1';
while(@month_tmp < '13')
begin
while(@day_tmp < '30')
begin
select * from table1 where [email protected]_tmp and [email protected]_tmp
set @day_tmp = @day_tmp + 1
end
set @month_tmp = @month_tmp + 1
set @day_tmp = 1
end
*********************************************************
select * from table1 where
month in('1','2','3','4','5','6','7','8','9','10','11','12'
and
day in('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30');
---
【oracle的循环语句怎么写】以上,希望对你有所帮助 。