设为首页 加入收藏

TOP

mysql UNION 语法详细说明与实例教程
2011-06-12 21:42:11 来源: 作者: 【 】 浏览:491次 评论:0

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 语法详细说明与实例教程更多相关文章

您看到此篇文章时的感受是:
Tags: 责任编辑:administrator
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到QQ空间
分享到: 
上一篇mysql sql DISTINCT 删除重复记.. 下一篇mysql delete 删除一条记录简单方..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

相关栏目

最新文章

图片主题

热门文章

推荐文章

相关文章

广告位