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(+)

解决方案 »

  1.   

    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(+)
      

  2.   

    楼上的 你的NVL()用在这里没有必要吧
      

  3.   

    对,这是一个典型的外连接问题。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(+)
      

  4.   

    修下以上回答: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(+)
      

  5.   

    楼上的,Choice表并没有passel字段