由两个表
tab_1
ID T1 T2
1 01 s
2 02 stab_2
d1 d2 d3
01 a 北京
03 e 北京
01 b 上海
02 c 上海查看tab_1时, 想得到如下结果(用tab_2中的d3='上海')
ID T1 T2
1 b s
2 c s谢谢各位兄弟
tab_1
ID T1 T2
1 01 s
2 02 stab_2
d1 d2 d3
01 a 北京
03 e 北京
01 b 上海
02 c 上海查看tab_1时, 想得到如下结果(用tab_2中的d3='上海')
ID T1 T2
1 b s
2 c s谢谢各位兄弟
from tab_1,tab_2
where tab_1.d2(+)='上海' and tab_1.T1(+) =tab_2.d2选择出的T2列是空的
from tab_1 a,tab_2 b
where a.t1=b.d1
and b.d3='上海'
from tab_1 a,
tab_2 b
where a.t1=b.d1
and b.d3='上海'
from tbl1 a
right join
(select * from tbl2
where t2 = '上海'
)b
on a.t1 = b.d2