@y int @c int select @x = 1 @y=1 while @x < 3 begin print @x --打印变量x 的值 while @y < 3 begin select @c = 100*@x + @y print @c --打印变量c 的值 select @y = @y + 1 end select @x = @x + 1 select @y = 1 end
--WAITFOR --例 等待1 小时2 分零3 秒后才执行SELECT 语句 waitfor delay ’01:02:03’ select * from employee --例 等到晚上11 点零8 分后才执行SELECT 语句 waitfor time ’23:08:00’ select * from employee
***SELECT***
select *(列名) from table_name(表名) where column_name operator value ex:(宿主) select * from stock_information where stockid = str(nid) stockname = 'str_name' stockname like '% find this %' stockname like '[a-zA-Z]%' --------- ([]指定值的范围) stockname like '[^F-M]%' --------- (^排除指定范围) --------- 只能在使用like关键字的where子句中使用通配符) or stockpath = 'stock_path' or stocknumber < 1000 and stockindex = 24 not stocksex = 'man' stocknumber between 20 and 100 stocknumber in(10,20,30) &上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页
|