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;

posted @ 2022-03-04 00:13  King-DA  阅读(38)  评论(0)    收藏  举报