当前位置:网站首页>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
边栏推荐
猜你喜欢

Qtablewidget header customization and beautification developed by pyqt5 (with source code download)

5.6 comprehensive case - RTU-

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

社区团购小程序源码+界面diy+附近团长+供应商+拼团+菜谱+秒杀+预售+配送+直播

让地球少些“碳”息 度能在路上

RPC过程

The annotation is self-defined by implementing the parameter parser handlermethodargumentresolver interface

The simple problem of leetcode is to calculate the numerical sum of strings

监控智能回放是什么,如何使用智能回放查询录像

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
随机推荐
DOM 学习之—添加+-按钮
基于TCP/IP协议的网络通信实例——文件传输
什么是RPC
QFileDialog select multiple files or folders
DOM学习笔记---遍历页面所有元素节点
ASAN 极简原理
Vowel substring in statistical string of leetcode simple problem
Talk about the basic but not simple stock data
LeetCode-199-二叉树的右视图
An idea plug-in that doesn't work, but can install X
dmp引擎工作总结(2021,光剑)
[learning] audio and video development from scratch (9) -- nuplayer
Online app resource download website source code
Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam
社区团购小程序源码+界面diy+附近团长+供应商+拼团+菜谱+秒杀+预售+配送+直播
RPC过程
Campus transfer second-hand market source code download
Transformer XL: attention language modelsbbeyond a fixed length context paper summary
[C语言] 文件操作《一》
Transformer-XL: Attentive Language ModelsBeyond a Fixed-Length Context 论文总结