select
(select badate from( select badate,ROW_NUMBER() OVER (ORDER BY badate) RNO from table2 where houseid=hd.houseid) a where RNO= 1) as badate
from table1 hd
10g 运行正常 9i运行hd.houseid 无效 什么情况 大神
...全文
1696打赏收藏
加急,急急急.......急急急.急急急.急急急.急急急.急急急.
select (select badate from( select badate,ROW_NUMBER() OVER (ORDER BY badate) RNO from table2 where houseid=hd.houseid) a where RNO= 1) as badate from table1 hd 10g 运行正常 9i运行hd.houseid 无效 什么情况 大神
叼毛,用这个试试吧。 select
(select badate from( select badate,rank() OVER (partition by subject ORDER BY badate) RNO from table2 where houseid=hd.houseid) a where RNO= 1) as badate
from table1 hd
如果不行就用左连接
select
(select badate from( select ht.badate
from table1 hd left join table2 ht on hd.houseid = ht.houseit
) a where RNO= 1) as badate
from table1 hd