日期:2014-05-17 浏览次数:20758 次
--俩表tb1,tb2 with tb1 as ( select 1 c1,'a' c2 from dual union all select 2 c1,'b' c2 from dual ), tb2 as ( select 1 c1,'aa' c2 from dual union all select 3 c1,'bb' c2 from dual ) --第一种 select a.c2,b.c2 from tb1 a,tb2 b where a.c1 = b.c1 c2 c2 ------------------- a aa --第二种 select a.c2,b.c2 from tb1 a left join tb2 b on a.c1 = b.c1 c2 c2 ------------------- a aa b
------解决方案--------------------
这2条语句没有区别,都是内连接,只是写法不同而以,怎么写看你喜好