select nvl(b.passel,'20021230'),a.Question,a.Code,a.Name,decode(b.code,null,'0','1') from Choices a,Answers b where a.Code=b.Code(+)
楼上的 你的NVL()用在这里没有必要吧
对,这是一个典型的外连接问题。select a.passel,a.Question,a.Code,a.Name,decode(b.code,null,'0','1') from Choices a,Answers b where a.Code=b.Code(+)
修下以上回答:select a.passel, a.Question, a.Code, a.Name, decode(b.code,null,'0','1') from Choices a, Answers b where a.QuestionNo=b.question and a.Code=b.Code(+)
a.Question,
a.Code,
a.Name,
decode(b.code,null,'0','1')
from Choices a,
Answers b
where a.QuestionNo=b.question
and a.Code=b.Code(+)