1
来源:互联网 发布:收音机软件不需要网络 编辑:程序博客网 时间:2024/05/01 12:20
简单说说SQL中的连接查询
在BOSS系统的代码中,基本都是两个表放在一起连接查询方式,不知道大家对其他几种常用的连接查询是否熟悉,所以我简单总结了一下,希望能对大家有所帮助。
1. inner join 内连接
inner join 与 join 等价,即inner 关键字可以省略
内连接就是我们平时最最常用的、BOSS中使用最多的、两个表放在一起的查询
例如:
如下两个句子的查询结果和效率是一样的
句1:(这是BOSS中使用最多的方式)
select t1.id as id1,t2.id as id2
from table1 t1,table2 t2
where t1.oid=t2.oid
句2:
select t1.id as id1,t2.id as id2
from table1 t1
join table2 t2 on t1.oid=t2.oid
- 1
- 1
- 1
- 1
- 1
- 1
- 1》
- 1
- 1
- 1
- 1
- (1)
- 1
- 1
- 1
- 1
- 1
- 1
- WordPress http://cn.wordpress.org/
- [双语阅读]APEC峰会菜肴东西合璧 少用葱蒜防口气
- PHP 小技巧
- omnetpp在windows下的编译
- CUDA学习之旅2009.11.13---《深入浅出CUDA》学习3
- 1
- malloc和free的实现
- IIS下FLV不能播放问题的解决
- 小众歌手 niche singer
- Far cry 天壤之别
- 股民必须牢记的二十一条军规
- 各类节目中的“噱头” watercooler moment
- 80后最具哲理的话
- Developer Connection: Tour de Flex