表1
id
1
5
2
d
3
表2
id1 id2 gz
3 20080711 2
5 20080711 1
1 20080011 3
我期望的是: 把ID2=20080711 带进去
id gz
1
5 1
2
d
3 2select biao1.id,gz from biao1,biao2 where biao2.id1(+)=biao1.id
这是现在用的语句 但是不能加 ID2=20080711 这个条件. 请问怎么写SQL可以带进这个条件呢
我想可以用临时表 然后 update id2!=20080711 就 ="" 然后输出临时表的信息
但是有没有用语句能写出来的方法? 请赐教...
id
1
5
2
d
3
表2
id1 id2 gz
3 20080711 2
5 20080711 1
1 20080011 3
我期望的是: 把ID2=20080711 带进去
id gz
1
5 1
2
d
3 2select biao1.id,gz from biao1,biao2 where biao2.id1(+)=biao1.id
这是现在用的语句 但是不能加 ID2=20080711 这个条件. 请问怎么写SQL可以带进这个条件呢
我想可以用临时表 然后 update id2!=20080711 就 ="" 然后输出临时表的信息
但是有没有用语句能写出来的方法? 请赐教...
select biao1.id,biao2.gz from biao1 inner join biao2 on biao1.id=biao2.id
where biao2.ID2=20080711
from biao1,biao2
where biao2.id1(+)=biao1.id and bao2.id2='20080711';
这样不行吗?
set id2=null where exits (select 1 from biao2 where id2<>20080711
就是要
select biao1.id,gz from biao1,(select * from biao2 where biao2.id2=20080711)t2 where t2.id1(+)=biao1.id
这个效果