ganlisxn 发表于 2013-1-27 04:41:48

sql语法收集

先看两张表
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 区别所有的数据。
 
页: [1]
查看完整版本: sql语法收集