select (select nvl(B.description,nvl((select c.description from C where
C.result_Id=B.result_Id),'Unkonw') ) from B where B.Sn=A.Sn and
B.Result_Id =A.Test_Result_Id ) from A where A.Sn='123'
当A表与B表关联不匹配时,B.description为空但是后面的值不显示为什么?
如果要以这个思路作,怎么改。谢谢!
当A表与B表关联不匹配时,B.Result_Id 也为空啊!!!
哪来的C记录可以取到c.description?
改为(select c.description from C where C.result_Id=A.Test_Result_Id)
select (select nvl(B.description,nvl((select c.description from C where
C.result_Id(+)=A.result_Id),'Unkonw') ) from B where B.Sn(+)=A.Sn and
B.Result_Id(+) =A.Test_Result_Id ) from A where A.Sn='123'