MySQL-联合查询

联合查询使用关键子union,用于在多个表种查询信息,并且信息类型相同的查询!

union 关键子用于联合查询

如:

(select *from student where student.score>10 limit 1)
union all
(select * from student where student.address = '湖北' limit 1)

union 可选为all和distinct

all选项表示不去掉重复的记录

distinct表示去掉重复的记录

posted @ 2019-02-19 14:12  哎呦,豹豹大人  阅读(110)  评论(0编辑  收藏  举报