T-SQL小例
3177 ワード
- declare @x int,@y int,@z int
- select @x=1,@y=2,@z=3--t-sql select , set
- if @x>@y
- print 'x>y'
- else if @y>@z
- print 'y>z'
- else print 'z>y'
-
- declare @x int ,@y int ,@c int
- select @x=1,@y =1
- while @x<3
- begin
- print @x
- while @y<3
- begin
- select @c = 100*@x+@y
- print @c
- select @y=@y+1
- end
- select @x=@x+1
- select @y=1
- end
-
- -- waitfor
- waitfor delay '00:00:30'-- 30
- select * from student
- waitfor time '18:18:18'-- 18:18:18
- select * from student