select *
from table1,table2
where (table2.col2 is null or table2.col2='value2')
and table1.col1 > table2.col1(+)不明白 你为什么要用右连接?

解决方案 »

  1.   

    select *
    from table1,table2
    where table2.col2='value2'
    and table1.col1 > table2.col1(+)这个语句执行并没有错误啊,返回0条数据楼主你的错误是什么?或者说你想返回什么样的数据?
      

  2.   

    table1和table2没有任何关联??? 那就是没有where了?
    试试看吧:select decode(t2.col2,'value2',t2.col1,t2.col2),.....其他字段
    from table1 t1,table2 t2
    where table1.col1 > table2.col1(+)
      

  3.   

    table2没有数据,table2.col2='value2'又怎麼可能
      

  4.   

    table2没数据!!!
    (table2.col2='value2')???
      

  5.   

    关键是where 后面的那个 null要不然当然没有数据看我上面的那段sql
      

  6.   

    注意你的table2.col2='value2','value2'要分大小写!