六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 70|回复: 0

sql语法收集

[复制链接]

升级  54%

35

主题

35

主题

35

主题

秀才

Rank: 2

积分
131
 楼主| 发表于 2013-1-27 04:41:48 | 显示全部楼层 |阅读模式
先看两张表
softball table
id    name
1     a
2     b
3     c
4     d
 
football table
 --------
id   name
1    a
2    c
3    k
4    g
union 和union all 区别
select name from softball
union
select name from football
 
rs:
name
=--------
a
b
c
d
k
g
union 区别出两张表重复的数据
select name from softball
union all
select name from football
name
-------
a
b
c
d
a
c
k
g
 
union all 区别所有的数据。
 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表