• 哇,union的优先级很高嘛


    原来,union的优先级很高。比如

    select stdname,[subject]='化学',化学 as score  from #student2 
    union all 
    select stdname,[subject]='数学',数学 as score  from #student2 
    union all 
    select stdname,[subject]='物理',物理 as score  from #student2 
    union all 
    select stdname,[subject]='语文',语文 as score  from #student2 
    order by stdname,[subject]

    等同于

    select * from(
    select stdname,[subject]='化学',化学 as score  from #student2 
    union all 
    select stdname,[subject]='数学',数学 as score  from #student2 
    union all 
    select stdname,[subject]='物理',物理 as score  from #student2 
    union all 
    select stdname,[subject]='语文',语文 as score  from #student2 
    ) as a
    order by stdname,[subject]


  • 相关阅读:
    实习第五十七天
    武汉第五十六天
    武汉第五十五天
    常用环境配置
    http 基本验证(nginx)
    nginx configuration
    docker run demo
    初识Hadoop
    大数据简介
    HDFS 存放策略
  • 原文地址:https://www.cnblogs.com/leftfist/p/4258014.html
Copyright © 2020-2023  润新知