• Oracle简单的SQL处理


    --单表插入
    insert into hr.job(job_id,job_title,min_salary) values('IT','Project Manager',50000);

    insert into scott.bonus(ename,job,sal)select ename,job,sal*0.10 from scott.emp;

    --多表插入

    insert all when sum_orders<10000 then
    into small_customers
    when sum_orders>=10000 and sum_orders<100000 then
    into medium_customers
    else
    into large_customers
    select customers_id,sum(order_total) sum_orders
    from oe.orders
    group by customer_id;

    --Update语句

    --创建副表
    create table scott.employees2 as select * from oe.employees;
    --add a primary key
    alter table employees2 add constraint emp2_emp_id_key primary key (employee_id);

  • 相关阅读:
    Roman to Integer
    Remove Element
    Maximum Subarray
    Climbing Stairs
    Binary Tree Preorder Traversal
    C++引用和指针
    adb
    Traceview
    解析xml
    SDK manager 下载不同版本sdk
  • 原文地址:https://www.cnblogs.com/shangshen/p/7085501.html
Copyright © 2020-2023  润新知