当前位置:网站首页>Gbase8s database union operator
Gbase8s database union operator
2022-07-22 18:10:00 【Like to eat radish ice cold】
take UNION Operators are placed in two SELECT Statements to combine queries into a single query .
have access to UNION Operator will be several SELECT Statements are strung together . The corresponding item does not need to have the same name . It can be done by
Omit ALL Keyword to exclude duplicate lines .
In this version GBase 8s in , Include in UNION Operator supports the combined query of numeric fields and numeric strings
Inquiry . The returned result is DECIMAL(16) or DECIMAL(32) ( Depends on the length of the returned value ) data type .
for example :
SELECT 123 FROM tab1 UNION SELECT ‘456’ FROM tab2;
The next example assumes tab1 In the table colid As a INT type :
SELECT col1id FROM tab1 UNION SELECT ‘111’ FROM tab2;
Use UNION You can also directly NULL Value and other types of column values , Without coercion NULL
Data type of . The type of the returned result is the same as NULL The data types of other types of values corresponding to values are consistent .
for example , In the following example, it is assumed that tab2 In the table colid The type of VARCHAR:
SELECT NULL as a1 FROM tab1
UNION SELECT colname FROM tab2
INTO tab3;
The database will automatically NULL The type of is converted to colname The data type of the column VARCHAR. see tab3
List the information :
info columns for tab3;
Return as follows :
Column name Type Nulls
A1 varchar(10)
边栏推荐
- 02-线性结构2 一元多项式的乘法与加法运算(链表求解)
- Super practical transformation strategy: 2022 central state-owned enterprise cloud native landing practical guide was officially released
- Boss直聘怎么写出优秀的简历?
- Detailed explanation of bokeh parameter setting
- MySQL数据库结合项目实战SQL优化总结
- 【论文汇总】2D目标检测文章汇总,持续更新
- GBase8s数据库SET CONNECTION 语句
- Aruba学习笔记04-Web UI --Configuration面板介绍
- 力扣练习——24 去除重复字母
- Web3 sharing
猜你喜欢
随机推荐
Arrays类的理解学习
Allegro如何导入高清Logo、二维码、防静电标识等图片以及汉字
[micro Service ~ remote call] integrate resttemplate, webclient, feign
24、 TF coordinate transformation (IV): multi coordinate transformation and coordinate system relationship view
方法论(一):如何快速学习一门编程语言
Dokcer运行Nacos容器自动退出问题
会议OA项目之会议发布功能
Niuke brush SQL
Unity TextMeshPro命名空间引用及组件获取
力扣练习——29 按要求补齐数组
逆袭黑马:数据库全栈工程师(DevDBOps)培训,把最好的课程送给您!
GBase8s数据库UNION 运算符
Abnormal understanding and learning
Understanding and learning of dates
Pytoch implements word2vec
GBase8s数据库子查询中的 UNION
以SPI的仿真文件学习TB写法
MySQL 常用函数
GBase8s数据库约束模式的保持
GBase8s数据库标识连接