当前位置:网站首页>Gbase8sunion all operator
Gbase8sunion all operator
2022-07-22 18:10:00 【Like to eat radish ice cold】
If you use UNION ALL Operator , Then all qualified rows are returned from the two queries , Without excluding any repetition
That's ok .( If you use UNION Operator without ALL Keyword to combine two queries , From the combination of qualified rows
Remove any duplicate rows from the set of . in other words , If there are many lines , Each column contains exactly the same value , So just keep
a line .)
The next example uses UNION ALL To combine two SELECT Result of statement , Without removing duplicate lines . The query returns in 2007
In the first quarter of 2008 List of all calls received during the first quarter of the year .
SELECT customer_num, call_code FROM cust_calls
WHERE call_dtime BETWEEN
DATETIME (2007-1-1) YEAR TO DAY
AND DATETIME (2007-3-31) YEAR TO DAY
UNION ALL
SELECT customer_num, call_code FROM cust_calls
WHERE call_dtime BETWEEN
DATETIME (2008-1-1)YEAR TO DAY
AND DATETIME (2008-3-31) YEAR TO DAY;
If you want to remove duplicate rows from the result set , Please use without keywords ALL Of UNION As a set operator between queries .
In the previous example , If two SELECT Statements all return combinations 101 B, be UNION Operator will cause the combination
List only once .( If you want to remove each SELECT Repeated lines in the statement , Then please follow Projection Clause
Select Use before the list DISTINCT or UNIQUE keyword , Like Allow repetition As described in .)
For designation, only UNION Set operation of operator ,ALL Keywords are valid . If ALL Keep up with the
INTERSECT、MINUS or EXCEPT After the set operator , These set operators exclude duplicate parts , Then database
The server sent an error .
To get information about how the database server has NLCASE INSENSITIVE Duplicate identification in the database of attribute NCHAR
or NVARCHAR Value information , See topic In case sensitive databases NCHAR and NVARCHAR surface
Da da .
边栏推荐
- 测试员职场最大的危机不是30岁,而是中年被裁
- Computer Graphics From Scratch - Chapter 4
- Distributed (I) what is sacred about distributed systems, base and cap?
- Methodology (I): how to quickly learn a programming language
- Go flag package
- Bigder:35/100 development colleagues said that I tested it myself. But something went wrong after the launch.
- Bigder:40/100 怎么组织一次用例评审
- Dokcer运行Nacos容器自动退出问题
- JS to determine whether the linked image exists
- vcs与verdi学习记录
猜你喜欢
随机推荐
日期类的理解学习
线性回归(公式推导+numpy实现)
Physical layer of network
超实用转型攻略:《2022央国企云原生落地实用指南》正式发布
mysql 自增主键出现不连续的原因?
Use of bullets in object pool mode in aircraft war
How Allegro imports pictures such as high-definition logo, QR code, anti-static logo and Chinese characters
vcs与verdi学习记录
Bigder: common business terms in 36/100 report testing
Shallow solution of ZMQ lockless queue
会议OA项目之会议发布功能
MySQL和MariaDB区别
GBase8s数据库SET COLLATION 语句
go 语言 结构体如何申明默认值 如何转化为json数据
1.4.1 好多好多道符(cin/cout解绑,O3优化)
mysql 如何查询Json数据里面的数据
go 切片,集合简单讲解
【案例分享】配置IS-IS的路由渗透功能
Dokcer运行Nacos容器自动退出问题
Excel导入导出Controller