zoukankan      html  css  js  c++  java
  • with as的用法

    –针对一个别名
    with tmp as (select * from tb_name)

    –针对多个别名
    with
    tmp as (select * from tb_name),
    tmp2 as (select * from tb_name2),
    tmp3 as (select * from tb_name3),


    --相当于建了个e临时表
    with e as (select * from scott.emp e where e.empno=7499)
    select * from e;

    --相当于建了e、d临时表
    with
    e as (select * from scott.emp),
    d as (select * from scott.dept)
    select * from e, d where e.deptno = d.deptno;
    其实就是把一大堆重复用到的sql语句放在with as里面,取一个别名,后面的查询就可以用它,这样对于大批量的sql语句起到一个优化的作用,而且清楚明了。

  • 相关阅读:
    5.线性回归算法
    4.K均值算法--应用
    3.K均值算法
    机器学习2
    机器学习1
    第十五次作业
    第十三次作业
    第十一次作业
    P1250 种树
    P1516 青蛙的约会
  • 原文地址:https://www.cnblogs.com/assasion/p/7763847.html
Copyright © 2011-2022 走看看