zoukankan      html  css  js  c++  java
  • 循环 游标

    declare @i int,@t int
    set @t=0;
    set @i=2;
    while @i<=10
    begin 
     set @t=@t+@i;
     set @i=@i+2;
    end
    print @t
    
    begin
     waitfor time'8:00'
     execute sp_addrole 'manager'
    end
    break continue return 
    View Code
    declare @ch int;
    set @ch=92;
    select char(@ch+5)
    
    select abs(-5),replace('abcdef','cd','SS'),substring('中国人民',3,2),ASCII('sql')
    select abs(0.0),abs(6.0),round(123.456,2),round(123.456,-2),rand(),rand(6)
    select left('山东职业学院',2),right('山东职业学院',3),substring('山东职业学院',3,2)
    select ascii('A'),CHAR(65)
    select str(5.392754,6,3),str(-7.566,4,2)
    View Code
    select getdate(),year(getdate()),month(getdate()),day(getdate())
    
    select 学号,sex=
     case 性别 
     when '' then '男生'
     when '' then '女生'
     end
     from stu
    
     declare @ss char(14);
     set @ss='数据结构'
     select cast(@ss as char(4)), convert(char(4),@ss)
    View Code
    create function average(@num int)
    returns int
    as 
    begin 
    declare @aver int
    select @aver =avg(age) from xscj where id=@num 
    return @aver
    end
    drop function average
    
    use test 
    go
    declare @num int,@res int;
    set @num=10;
    --select @res=dbo.average(@num)
    exec @res=dbo.average @num= @num
    print @res
    
    
    create table xscj(
    id int not null identity(1,1) primary key,
    age int
    )
    
    declare @i int;
    set @i=1;
    while @i<=20
    begin 
     insert xscj values(@i);
     set @i=@i+1;
    end 
    View Code
  • 相关阅读:
    Python并发编程—自定义线程类
    Python并发编程—线程对象属性
    syfomny 好教材....
    drupal_get_css -- drupal
    common.inc drupal
    date iso 8610
    js很好的教材
    user_load_by_name
    eck add form
    把一个表导入到另一个地方...
  • 原文地址:https://www.cnblogs.com/futengsheng/p/7906796.html
Copyright © 2011-2022 走看看