union和union all的用法
将两个select的结果作为一个整体显示出来。
满足条件:
1、两个select查询的列的数量必须相同;
2、每个列的数据类型需要相似;
区别
union all是将两个select语句的结果求并集。 union是将union all的结果下再去除重复数据
世界上最美的风景,是自己努力的模样
将两个select的结果作为一个整体显示出来。
满足条件:
1、两个select查询的列的数量必须相同;
2、每个列的数据类型需要相似;
union all是将两个select语句的结果求并集。 union是将union all的结果下再去除重复数据
世界上最美的风景,是自己努力的模样
上一篇:PHP导出身份证号科学计数法
下一篇:php 如何实现自动加载
在某些情况下,or条件可以避免全表扫描的。1 .where 语句里面如果带有or条件, myisam表能用到
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M