mysql学习之union
union
1.要求多条查询语句的查询列数是一致的
2.要求多条查询语句的查询的每一列的类型和顺序是一致的
3.union关键字默认去重,如果使用union all 可以包含重复项
select * from employees where email like '%a%' or department_id>90;
select * from employees where email like '%a%'
union
select * from employees where department_id>90;

本文来自博客园,作者:King-DA,转载请注明原文链接:https://www.cnblogs.com/qingmuchuanqi48/articles/15962618.html

浙公网安备 33010602011771号