龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 数据库类 > MySQL 技术 >

mysql UNION 语法详细说明与实例教程

时间:2011-03-14 23:24来源:未知 作者:admin 点击:
分享到:
mysql教程 union 语法详细说明与实例教程 本文介绍如何在mysql中使用union来组合成一个单一的结果 union语法 select field1, field2 ...union [all | distinct]select field1, field2 ... 下面看一款查询三个表普

mysql教程 union 语法详细说明与实例教程

本文介绍如何在mysql中使用union来组合成一个单一的结果

union语法

select field1, field2 ...union [all | distinct]select field1, field2 ...

下面看一款查询三个表普通方法

select brand from car;
select brand from computer;
select brand from clothing;

我们利用union连接起来查询


select brand from car union select brand from computer union select brand from clothing;

select brand from car union all select brand from computer union allselect brand from clothing;

 

mysql UNION 语法详细说明与实例教程更多相关文章

精彩图集

赞助商链接