当前位置:网站首页>SQL中 with函数的详解与用法
SQL中 with函数的详解与用法
2022-04-23 06:05:00 【旺财2】
WITH AS短语,也叫做子查询部分,定义一个SQL片断后,该SQL片断可以被整个SQL语句所用到。有的时候,with as是为了提高SQL语句的可读性,减少嵌套冗余。
在标准的数据库中,如hive,Oracle,DB2,SQL SERVER,PostgreSQL都是支持WITH AS 语句进行递归查询。只有MySQL是不支持的。
with A as
(select distinct(sno),sname,ssex,sclass from student),
B as
(select sno,cno,degree from score )
--使用上面定义好的A,B
select * from A,B
where A.sno =B.sno
版权声明
本文为[旺财2]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wdyliuxingfeiyang/article/details/121861278
边栏推荐
- Thanos Compact组件测试总结(处理历史数据)
- Prometheus Thanos与Cortex组件比较
- Prometheus和Thanos Receiver的“写多租户”实现
- RAC环境集群组件gpnp未启动成功问题分析
- 几款电纸书阅读器参数对比
- select命令产生redo日志问题的分析
- Openvswitch compilation and installation
- [MySQL basics] startup options and configuration files
- 通过源码探究@ModelAndView如何实现数据与页面的转发
- Virtio and Vhost_ Net introduction
猜你喜欢
Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决
Ali vector library Icon tutorial (online, download)
【机器学习】笔记 4、KNN+交叉验证
Prometheus Cortex使用Block存储时的相关问题
Practice using polardb and ECs to build portal websites
实践使用PolarDB和ECS搭建门户网站
try catch 不能捕获异步错误
通过源码探究@ModelAndView如何实现数据与页面的转发
Build a cloud blog based on ECS (send blessings on the cloud Xiaobao code and draw iphone13 for free)
OVS and OVS + dpdk architecture analysis
随机推荐
Abnormal record-13
select命令产生redo日志问题的分析
"Write multi tenant" implementation of Prometheus and thanos receiver
冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影
Build an OSS based image sharing website - polite feedback
RAC环境中openssh版本对SSH互信创建的影响
How to use tiup to deploy a tidb V5 0 cluster
异常记录-17
Chaos帶你快速上手混沌工程
19C环境ORA-01035登陆报错处理
Prometheus Cortex使用Block存储时的相关问题
基于EMR离线数据分析-反馈有礼
异常记录-14
Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决
异常记录-8
Introduction to DDoS attack / defense
TC ebpf practice
Thanos Compactor组件使用
异常记录-19
Abnormal record-12