我的实际查询是这样的,A表是一句查询语句查出一个类似A表这样的结果然后再联接查询,A中的type_id为空值的记录就不被列出来

解决方案 »

  1.   

    这样就可以呀,我刚才试了:
    select count(*) from A,B where A.type_id=B.type_id(+);
    看下:
      

  2.   

    to:  doer_ljy(可战) 子查询出来确实是会有type_id为空的这样的记录,(是子查询出来的,我不清楚是null还是空)
    最后不被列出来。 
      

  3.   

    是最后select A.type_id, B.type ,A.value from A,B where A.type_id=B.type_id(+); 不列出来
      

  4.   

    SQL> select * from a;     VALUE VALUE_DATE  ID
    ---------- ----------- ----------
            10 2004-1-7 18 1
            10 2004-1-7 18 2
            10 2004-1-7 18 3
            20 2004-1-7 18 SQL> select * from b;ID         TYPE
    ---------- ----------
    1          aa
    2          bbSQL> select a.id,value_date from a,b where a.id=b.id(+);ID         VALUE_DATE
    ---------- -----------
    1          2004-1-7 18
    2          2004-1-7 18
    3          2004-1-7 18
               2004-1-7 18测试正确
      

  5.   

    你把一个子查询结果集生成一个临时表好了!就是select 字段 into 临时表A 发from 表!
    再用select A.type_id, B.type ,A.value from A,B where A.type_id=B.type_id(+);