龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 数据库类 > 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 语法详细说明与实例教程更多相关文章

收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!

热评话题

按钮 内容不能为空!
立刻说两句吧! 查看0条评论
精彩图集

赞助商链接