• 临时表的使用及minus运算


    ----Oracle minus差运算: 打不开的网站=================================
    --
    创建会话临时表
    drop table YKY_Website_No;
    create global temporary table YKY_Website_No
    (
      Website_No 
    varchar2(10)
    on Commit Preserve Rows;

    insert into YKY_Website_No(Website_No)values('FM37');
    insert into YKY_Website_No(Website_No)values('FM38');
    insert into YKY_Website_No(Website_No)values('FM39');
    insert into YKY_Website_No(Website_No)values('FM41');
    insert into YKY_Website_No(Website_No)values('FM42');
    insert into YKY_Website_No(Website_No)values('FM43');
    insert into YKY_Website_No(Website_No)values('FM44');
    insert into YKY_Website_No(Website_No)values('FM45');
    insert into YKY_Website_No(Website_No)values('FM46');
    insert into YKY_Website_No(Website_No)values('FM48');
    insert into YKY_Website_No(Website_No)values('FM49');
    insert into YKY_Website_No(Website_No)values('FM50');
    insert into YKY_Website_No(Website_No)values('FM51');
    insert into YKY_Website_No(Website_No)values('FM52');
    insert into YKY_Website_No(Website_No)values('FM107');
    insert into YKY_Website_No(Website_No)values('FM108');
    insert into YKY_Website_No(Website_No)values('FM109');
    insert into YKY_Website_No(Website_No)values('FM110');
    insert into YKY_Website_No(Website_No)values('FM111');
    insert into YKY_Website_No(Website_No)values('FM112');
    insert into YKY_Website_No(Website_No)values('FM121');
    insert into YKY_Website_No(Website_No)values('NW35');
    insert into YKY_Website_No(Website_No)values('NW36');
    insert into YKY_Website_No(Website_No)values('NW37');
    insert into YKY_Website_No(Website_No)values('NW38');
    insert into YKY_Website_No(Website_No)values('NW39');
    insert into YKY_Website_No(Website_No)values('NW40');
    insert into YKY_Website_No(Website_No)values('NW41');
    insert into YKY_Website_No(Website_No)values('NW42');
    insert into YKY_Website_No(Website_No)values('NW43');
    insert into YKY_Website_No(Website_No)values('BG9');
    insert into YKY_Website_No(Website_No)values('BG10');
    insert into YKY_Website_No(Website_No)values('BG11');
    insert into YKY_Website_No(Website_No)values('BG12');
    --Minus运算得到打不开的网站编号
    select Website_No from YKY_Website_No
    minus
    select Website_No from article_detail where 
    website_no 
    in ('FM37','FM38','FM39','FM41','FM42','FM43','FM44','FM45','FM46',
    'FM48','FM49','FM50','FM51','FM52','FM107','FM108','FM109','FM110','FM111','FM112','FM121',
    'NW35','NW36','NW37','NW38','NW39','NW40','NW41','NW42','NW43',
    'BG9','BG10','BG11','BG12'
    )
    group by website_no having count(*)>0
    order by Website_No;
  • 相关阅读:
    java 线程开启 中断
    手写迷你版hashmap
    基于状态机的乐观锁
    Python清空指定文件夹下所有文件的方法
    Python
    python+selenium配置Edge浏览器
    python+selenium怎么获取ul下面最后一个li或ul中有多少个li
    Python Selenium 笔记
    XPath定位时,使用文本的方法小技巧。
    python yield返回多个值
  • 原文地址:https://www.cnblogs.com/krisy/p/1645022.html
Copyright © 2020-2023  润新知