当前位置:网站首页>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;
边栏推荐
- ESP8266简介:三种编程方式「建议收藏」
- 开源机器学习平台
- Meichuang was selected as one of the first member units of the "business security promotion plan" of the ICT Institute
- Is the table queried by this EMR sparksql node ODPs?
- 亲测!Centos7部署PHP + Swoole
- Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cycle functions [chapter]
- Pytorch - 分布式通信原语(附源码)
- 【VTK】MFC基于VTK8.2的网格编辑器
- How to obtain method parameter values through WinDbg
- AOSP ~ 初始化语言
猜你喜欢

Numpy的ndarray数组基础

【文献翻译】Concealed Object Detection(伪装目标检测)

嵌入式数据库开发编程(四)——DDL、DML

Matlab GUI realizes the function of clicking the button, opening the file dialog box and importing pictures

Pro test! Centos7 deploy PHP + spool

Jericho's position on initiating the connection back to the opposite ear: 【 chapter 】

普通用户使用vscode登录ssh编辑root文件

【毕业季】总结过去,展望未来

RepOptimizer: 其实是RepVGG2

信息技术应用创新专业人员(数据库)中级培训火热招生中(7月6-10日)
随机推荐
Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan
初次使用 eolink 感受
合约量化交易系统玩法开发 (现成案例分析)
XML external entity injection vulnerability (I)
TTChat x Zadig 开源共创 Helm 接入场景,环境治理搞得定!
美创入选信通院“业务安全推进计划”首批成员单位
Jericho's position on initiating the connection back to the opposite ear: 【 chapter 】
Sofaregistry source code | data synchronization module analysis
SOFARegistry 源码|数据同步模块解析
力扣每日一题-第31天-13.三角形的最大周长
2022广西省安全员C证考试试题及模拟考试
ShanDong Multi-University Training #3
LM07丨细聊期货横截面策略
Meichuang was selected as one of the first member units of the "business security promotion plan" of the ICT Institute
Zhengda futures liu4 data integration
又一所“省会大学”,来了!
Li Kou daily question - day 31 -1779 Find the nearest point with the same X or Y coordinate
Return value‘s Lifetime
MMdet中的Resnet源码解读+Ghost模块
启泰观察:职业精英创业必踩巨坑之 --- 学习效果坑