高效SQL

作者: 奇乞祈兴 | 来源:发表于2018-08-22 09:01 被阅读0次
    select colA, dump(colA), ascii(colA),colb from kkss order by  colA desc
    
    
    create table kkss(colA char(10),colAA varchar(10),colB number);
      insert into  kkss values('a','a',1);
          insert into  kkss values('bb','bb',2);    
          insert into  kkss values('5','5',5);
          insert into  kkss values('44','44',44);
          insert into  kkss values('33','33',33);
    
    create table LCK
    (name varchar2(60),
     sex  varchar2(10),
     old  number (20),
     comments varchar2(30))
     
     
    PCTFREE 99 PCTUSED 1;
    
    
    DECLARE n number;
            t_name varchar2(60);
            t_sex  varchar2(20);
            t_comments  varchar2(30);
    BEGIN    
    FOR I IN 1..16000 LOOP
        t_name:='1234567890,1234567890,1234567890,1234567890,1234567890,'||to_char(I);
        t_sex:='mail'||to_char(I);
        t_comments:='verygood'||to_char(I);
        n:=n+1;
    execute immediate  'INSERT INTO LCK (name,sex,old,comments) VALUES(:v1,:v2,:v3,:v4)' using t_name,t_sex,I,t_comments ;
    commit;
    END LOOP;
    END;
    
    create table LCK
    (name varchar2(60),
     sex  varchar2(10),
     old  number (20),
     comments varchar2(30))
    
    PARTITION BY RANGE (old)
    (
    PARTITION p1 VALUES LESS THAN (1000), 
    PARTITION p2 VALUES LESS THAN (2000), 
    PARTITION p3 VALUES LESS THAN (3000), 
    PARTITION p4 VALUES LESS THAN (4000), 
    PARTITION p5 VALUES LESS THAN (5000), 
    PARTITION p6 VALUES LESS THAN (6000), 
    PARTITION p7 VALUES LESS THAN (7000), 
    PARTITION p8 VALUES LESS THAN (8000), 
    PARTITION p9 VALUES LESS THAN (9000), 
    PARTITION p10 VALUES LESS THAN (10000), 
    PARTITION p11 VALUES LESS THAN (MAXVALUE))
    

    相关文章

      网友评论

          本文标题:高效SQL

          本文链接:https://www.haomeiwen.com/subject/pskeiftx.html