当前位置:网站首页>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
边栏推荐
- Asan minimalism
- Shell脚本进阶
- CGM optimizes blood glucose monitoring and management -- Yiyu technology appears in Sichuan International Medical Exchange Promotion Association
- LeetCode简单题之三除数
- stm32以及freertos 堆栈解析
- DOM学习笔记---遍历页面所有元素节点
- 5.6 comprehensive case - RTU-
- form表单 post提交 数据量大的问题
- Generate and parse tokens using JWT
- 万物互联下如何对设备进行加密
猜你喜欢

Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam

Shell脚本进阶

青苹果影视系统源码 影视聚合 影视导航 影视点播网站源码

项目上传部分

My heart's broken! A woman's circle of friends envied others for paying wages on time and was fired. Even her colleagues who liked her were fired together

LeetCode簡單題之計算字符串的數字和

Flink SQL实现流批一体

QT reading and writing XML files

输入/输出系统

Ansible Automation Operation and Maintenance details (ⅰ) Installation and Deployment, Parameter use, list Management, Profile Parameters and user level ansible operating environment Construction
随机推荐
单点登录 SSO
Rotation function of leetcode medium problem
idea:使用easyYapi插件导出yapi接口
Rearranging log files for leetcode simple question
Detailed explanation of ansible automatic operation and maintenance (I) installation and deployment, parameter use, list management, configuration file parameters and user level ansible operating envi
数据的删除和修改操作(mysql)
一键清理项目下pycharm和Jupyter缓存文件
Asan minimalism
AAAI 2022 recruit speakers!!
项目上传部分
微信小程序 catchtap=“toDetail“ 事件问题
Talk about the basic but not simple stock data
LeetCode简单题之重新排列日志文件
WordPress love navigation theme 1.1.3 simple atmosphere website navigation source code website navigation source code
情境领导者-第七章、解决绩效问题
分布式消息中间件框架选型-数字化架构设计(7)
谈谈那些基础但不简单的股票数据
耳穴诊疗随笔0421
Input / output system
Goland 调试go使用-大白记录