当前位置:网站首页>pgsql想实现mysql一样样的列子查询操作
pgsql想实现mysql一样样的列子查询操作
2022-04-23 07:52:00 【CSDN问答】
mysql可以用子查询引用之前列进行计算:
select n0 * 3 as n1, (select n1 * 2) from (select 1 n0) t1

但是postgresql 怎么实现呢?目前知道只能嵌套到下一层可行;直接引用如mysql是会提示找不到n1列的。
select *, (select n1 * 2) from (select n0 * 3 n1 from (select 1 n0) t1) t
可是要知道,嵌套多层是很不方便的,统计数据是很难受的嵌套一次起一个别名;只是引用之前列,如mysql方便多了。
版权声明
本文为[CSDN问答]所创,转载请带上原文链接,感谢
https://ask.csdn.net/questions/7693109
边栏推荐
- There are some problems when using numeric type to query string type fields in MySQL
- CGM优化血糖监测管理——移宇科技亮相四川省国际医学交流促进会
- 2022.4.11-4.17 AI industry weekly (issue 93): the dilemma of AI industry
- 室内定位技术对比
- colorui 解决底部导航遮挡内容问题
- 刨析——浏览器如何工作
- 剑指offer day24 数学(中等)
- [learning] audio and video development from scratch (9) -- nuplayer
- dmp引擎工作总结(2021,光剑)
- Flink SQL实现流批一体
猜你喜欢

【解释】get ORA-12838: cannot read/modify an object after modifying it in parallel

Listed on the Shenzhen Stock Exchange: the market value is 5.2 billion yuan. Lu is the East and his daughter is American

A simple theme of Typecho with beautiful appearance_ Scarfskin source code download

vslam PPT

通过实现参数解析器HandlerMethodArgumentResolver接口来自定义注解
![[C语言] 文件操作《一》](/img/89/b19dda13d27e37fedf6736c102245b.png)
[C语言] 文件操作《一》

Install MySQL for Ubuntu and query the average score

mysql查询字符串类型的字段使用数字类型查询时问题

vslam PPT

信息收集相关知识点及题解
随机推荐
程序,进程,线程;内存结构图;线程的创建和启动;Thread的常用方法
使用JWT生成与解析Token
[learning] audio and video development from scratch (9) -- nuplayer
Qtablewidget header customization and beautification developed by pyqt5 (with source code download)
Qt编译QtXlsx库
[effective go Chinese translation] part I
[effective go Chinese translation] function
A simple theme of Typecho with beautiful appearance_ Scarfskin source code download
Comparison of indoor positioning technology
C language learning record -- use and analysis of string function (2)
LeetCode简单题之重新排列日志文件
freertos学习02-队列 stream buffer message buffer
stm32以及freertos 堆栈解析
396. Rotate Function
LeetCode中等题之旋转函数
监控智能回放是什么,如何使用智能回放查询录像
Listed on the Shenzhen Stock Exchange: the market value is 5.2 billion yuan. Lu is the East and his daughter is American
ansible自动化运维详解(一)ansible的安装部署、参数使用、清单管理、配置文件参数及用户级ansible操作环境构建
Flink SQL实现流批一体
刨析——浏览器如何工作