Home > Notes > SQL之JOIN结构简单理解

SQL之JOIN结构简单理解

Fri, 18 Sep 2009 23:30:52 +0800

以前写JOIN的时候都是这样:

select * from a join b on a.xx=b.yy where a.zz=ww

现在遇到了多表联合了,一下连join几个都不对,其实,可以这样理解,SELECT 就是从某个源取得数据的,所以应该这样:

select * from (((a join b on a.xx=b.yy) join c on c.zz=a.ww) join d on d.kk=c.ii .....)......

括号内的是表联合后构成的数据源

Hots
评论
发表评论:


  [TIPS:首次发表评论的朋友,需要验证]
Tags
Recent Post
Recent Comments
Links
Copyright Notes
You can reship all of these articles without permission but MUST mark the original link in your post. Please contact with me() if u have advice or other arrangements.
Copyright©2007-2011 lewphee.com All rights reserved.