当前位置:网站首页>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;
边栏推荐
- 小白学习MySQL - 增量统计SQL的需求 - 开窗函数的方案
- 杰理之发起对耳配对、回连、开启可发现、可连接的轮循函数【篇】
- 记一次 MSI 笔记本 GE63 播放网页视频 闪屏和随机发绿 问题解决
- 智能垃圾桶(四)——树莓派pico实现超声波测距(HC-SR04)
- Helping the ultimate experience, best practice of volcano engine edge computing
- 杰理之关于 TWS 交叉配对的配置【篇】
- iMile 利用 Zadig 多云环境周部署千次,跨云跨地域持续交付全球业务
- Oracle netsuite helps TCM bio understand data changes and make business development more flexible
- Take another picture of cloud redis' improvement path
- 杰理之关于 TWS 交叉配对的配置【篇】
猜你喜欢

When a technician becomes a CEO, what "bugs" should be modified?

自动化测试摸索之路---准备工作

pod安全策略(PSP)

钛动科技:我们的 Zadig 落地之路

Meichuang was selected as one of the first member units of the "business security promotion plan" of the ICT Institute

Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions

AUTOCAD——文字显示方式、CAD怎么直接打开天正图纸

每周推荐短视频:爱因斯坦是怎样思考问题的?

Oracle netsuite helps TCM bio understand data changes and make business development more flexible

win11网页版
随机推荐
Meichuang was selected as one of the first member units of the "business security promotion plan" of the ICT Institute
Pytoch - distributed communication primitive (with source code)
服务数百万开发者,首届 Techo Day 腾讯技术开放日发布 7 款“轻量级”产品
ShanDong Multi-University Training #3
Is the table queried by this EMR sparksql node ODPs?
Jerry's manual pairing method [chapter]
在校生的编程故事
谷粒商城项目
恒泰证券开户安全吗 证券排名
MariaDB的安装与配置
嵌入式数据库开发编程(四)——DDL、DML
跟着官方学电机,BLDC两种控制策略,学到即赚到
Rebuild confidence in China's scientific research - the latest nature index 2022 released that China's research output increased the most
正大期货留4数据整合
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
Numpy的ndarray数组基础
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
C语言##__VA_ARGS__的用法
When a technician becomes a CEO, what "bugs" should be modified?
力扣每日一题-第31天-1779.找到最近的有相同x或y坐标的点