当前位置:网站首页>Differences between MySQL Union and union all
Differences between MySQL Union and union all
2022-07-03 11:53:00 【inexaustible】
union: For multiple result sets (select sentence ) To perform union operations , Do not include repeating lines , Sort at the same time .
union all: For multiple result sets (select sentence ) To perform union operations , Include repeating lines , No sorting .
Inside select Statements must have the same number of columns , Columns must also have similar data types , At the same time, each select The order of the columns of the statement must be the same .
select A.*
from
(
SELECT 1 flag,t.id,t.name,t.status,t.task_type,u.nickname,t.create_time,t.end_time,t.start_time,t.creator
from camas_survey_task t,system_user u
where t.status = 3 and t.deleted = 0 and t.creator = u.id
union all
select 2 flag,mr.id,mr.name,mr.status,-1 task_type,u.nickname,mr.create_time,mr.end_time,mr.start_time,mr.creator
from camas_survey_monitor_rule mr,system_user u
where mr.status = 3 and mr.deleted = 0 and mr.creator = u.id
)A
order by A.start_time asc边栏推荐
- Introduction to the implementation principle of rxjs observable filter operator
- Some common terms
- Spl06-007 air pressure sensor (example of barometer)
- CGroup introduction
- typeScript
- 金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
- libvirt 中体验容器
- (数据库提权——Redis)Redis未授权访问漏洞总结
- Niuniu's team competition
- The uniapp scroll view solves the problems of high adaptability and bullet frame rolling penetration.
猜你喜欢

Vulnhub geminiinc

ArcGIS application (XXI) ArcMap method of deleting layer specified features

Ripper of vulnhub

Excel快速跨表复制粘贴

Machine learning 3.2 decision tree model learning notes (to be supplemented)

导师对帮助研究生顺利完成学业提出了20条劝告:第一,不要有度假休息的打算.....

OpenGL 绘制彩色的三角形

cgroup简介

小鹏 P7 撞护栏安全气囊未弹出,官方回应称撞击力度未达到弹出要求

AI模型看看视频,就学会了玩《我的世界》:砍树、造箱子、制作石镐样样不差...
随机推荐
STL教程8-map
Software testing weekly (issue 78): the more confident you are about the future, the more patient you are about the present.
小鹏 P7 撞护栏安全气囊未弹出,官方回应称撞击力度未达到弹出要求
R语言ggplot2可视化:gganimate包创建动态折线图动画(gif)、使用transition_reveal函数在动画中沿给定维度逐步显示数据、在折线移动方向添加数据点
VS2015的下载地址和安装教程
Master and backup role election strategy in kept
vulnhub之pyexp
Xml的(DTD,xml解析,xml建模)
Duplicate numbers in the array of sword finger offer 03
rxjs Observable filter Operator 的实现原理介绍
Momentum of vulnhub
聊聊Flink框架中的状态管理机制
鸿蒙第三次培训(项目实训)
R language uses grid of gridextra package The array function combines multiple visual images of the lattice package horizontally, and the ncol parameter defines the number of columns of the combined g
Dynamically monitor disk i/o with ZABBIX
DS90UB949
R language uses the aggregate function to calculate the mean value (sum) of dataframe data grouping aggregation without setting na The result of RM calculation. If the group contains the missing value
cgroup简介
MySQL union和union all区别
2022年中南大学夏令营面试经验