当前位置:网站首页>GBase8s数据库对 STANDARD 或 RAW 结果表排序
GBase8s数据库对 STANDARD 或 RAW 结果表排序
2022-06-29 11:28:00 【爱吃萝卜冰冰凉】
当 SELECT INTO Table 子句定义要存储查询的结果的永久表时,那个子句中的任何非平凡的列表
达式还必须为新创建的结果表中相应的列声明别名。要指定那一列作为结果表的排序键,ORDER
BY 子句还必须引用相同的别名,而不是指定非平凡的列表达式。
例如,在下列嵌套查询中,tab56 是结果表的标识符,且 tab56_col0 是子查询在 Projection 子句
中定义的非平凡的列表达式的别名。ORDER BY 子句指定相同的子查询作为排序键,而不是通过
它的别名引用那个非平凡的列:
SELECT ( SELECT tab54.tab54_col7 tab56_col0
FROM tab54
WHERE (tab54.tab54_col7 = -1423023 )
) tab56_col0,
“” tab56_col1
FROM tab57
WHERE tab57.tab57_col1 == -6296233
ORDER BY (
SELECT tab54.tab54_col7 tab56_col0
FROM tab54
WHERE (tab54.tab54_col7 = -1423023 )
) NULLS FIRST,2 NULLS FIRST
INTO tab56;
在正常的 SELECT 语句中,在 ORDER BY 子句中指定非平凡的列表达式是可接受的,但在对一
由 SELECT INTO Table 子句创建了的结果表进行排序的 ORDER BY 子句中是不可接受的。在上
述示例中,数据库服务器返回 SQL 错误 -19828。
要避免此错误,必须修改上述示例,将非平凡的列表达式从 ORDER BY 子句移除,以它的别名取
代那个表达式:
SELECT ( SELECT tab54.tab54_col7 tab56_col0
FROM tab54
WHERE (tab54.tab54_col7 = -1423023 )
) tab56_col0,
“” tab56_col1
FROM tab57
WHERE tab57.tab57_col1 == -6296233
ORDER BY
tab56_col0 – Substituted alias for column expression in result table)
NULLS FIRST,2 NULLS FIRST
INTO tab56;
边栏推荐
- 地平线开发板配置网段
- Embedded database development programming (IV) -- DDL, DML
- Pytoch - distributed communication primitive (with source code)
- Win11 web version
- How to view saved passwords of websites
- 美创入选信通院“业务安全推进计划”首批成员单位
- Binary tree recursion and iteration
- 力扣每日一题-第31天-1779.找到最近的有相同x或y坐标的点
- 合约量化交易系统玩法开发 (现成案例分析)
- matlab fmincon 精度,fmincon与quadprog误差
猜你喜欢

Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan

leetcode刷题:字符串07(重复的子字符串)

亲测!Centos7部署PHP + Swoole

When you are young, you should be awake to fight, and when you are young, you should have the courage to try

又一所“省会大学”,来了!

AutoCAD - text display mode and how CAD can directly open Tianzheng drawings

初次使用 eolink 感受

Object class - the father of ten thousand classes

TTChat x Zadig 开源共创 Helm 接入场景,环境治理搞得定!

基于字节码的统一异常上报实践
随机推荐
Oracle expands distributed cloud services to bring comprehensive public cloud services to more customers
Helping the ultimate experience, best practice of volcano engine edge computing
面试突击61:说一下MySQL事务隔离级别?
What is the main account of Chia Tai futures used for 4 quotation software?
请问股票开户收费吗 网上开户安全吗?
二叉树递归与迭代
MySQL enable slow query
matlab fmincon 精度,fmincon与quadprog误差
Take another picture of cloud redis' improvement path
Jericho's position on initiating the connection back to the opposite ear: 【 chapter 】
Li Kou daily question - day 31 -1779 Find the nearest point with the same X or Y coordinate
当技术人成长为 CEO,应该修改哪些“Bug”?
杰理之关于 TWS 配对方式配置【篇】
【文献翻译】Concealed Object Detection(伪装目标检测)
力扣每日一题-第31天-1779.找到最近的有相同x或y坐标的点
如何查看网站已经保存的密码
钛动科技:我们的 Zadig 落地之路
2022 question bank and simulation test for documenter post skills (documenter) operation certificate examination
镜像漏洞扫描工具:Trivy
ShanDong Multi-University Training #3