高手请进,一个空表问题!
已知: table1, table2,其中table1有数据,table2没有数据,table1和table2没有任何关联。
现在,我想得到的数据是:
当table2.col2='value2'时,得到table2.col1
取得select * from table1 where table1.col1 > table2.col1
问:
我写的sql是:
select *
from table1,table2
where table2.col2='value2'--错误原因
and table1.col1 > table2.col1(+)
但是这个查询是空表。
请问应该怎么写?