我是靠谱客的博主 简单彩虹,这篇文章主要介绍哇,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]


最后

以上就是简单彩虹最近收集整理的关于哇,union的优先级很高嘛的全部内容,更多相关哇,union内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(108)

评论列表共有 0 条评论

立即
投稿
返回
顶部