当前位置:网站首页>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
边栏推荐
- 抓包整理外篇fiddler———— 会话栏与过滤器[二]
- Cacti monitors redis implementation process
- uniapp scroll view 解决高度自适应、弹框滚动穿透等问题。
- Yintai department store ignites the city's "night economy"
- Cacti监控Redis实现过程
- R语言使用原生包(基础导入包、graphics)中的hist函数可视化直方图(histogram plot)
- Kibana - installation and configuration of kibana
- GCC compilation process and dynamic link library and static link library
- 鸿蒙第四次培训
- Raven2 of vulnhub
猜你喜欢
(数据库提权——Redis)Redis未授权访问漏洞总结
Mmc5603nj geomagnetic sensor (Compass example)
vulnhub之Ripper
ArcGIS应用(二十一)Arcmap删除图层指定要素的方法
GCC compilation process and dynamic link library and static link library
Vulnhub's Nagini
Yintai department store ignites the city's "night economy"
Cadence background color setting
基于turtlebot3实现SLAM建图及自主导航仿真
Kubernetes 三打探针及探针方式
随机推荐
Vulnhub pyexp
PHP基础
Xiaopeng P7 hit the guardrail and the airbag did not pop up. The official responded that the impact strength did not meet the ejection requirements
小鹏 P7 撞护栏安全气囊未弹出,官方回应称撞击力度未达到弹出要求
Understand go language context in one article
Qt OpenGL 纹理贴图
外插散点数据
STL tutorial 8-map
Extrapolated scatter data
Vulnhub's presidential
OpenGL 索引缓存对象EBO和线宽模式
R语言使用data.table包进行数据聚合统计计算滑动窗口统计值(Window Statistics)、计算滑动分组中位数(median)并合并生成的统计数据到原数据集中
OpenStack中的测试分类
OpenGL 着色器使用
vulnhub之cereal
Concurrent programming - singleton
. \vmware-vdiskmanager. exe -k “c:\\xxxxx.vmdk”
PHP Basics
STL Tutorial 9 deep copy and shallow copy of container elements
The excel table is transferred to word, and the table does not exceed the edge paper range