houseid=hd.houseid提出来 where RNO= 1 and houseid=hd.houseid
ROW_NUMBER() OVER () 在9I里能使用吗?
叼毛,用这个试试吧。 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
where RNO= 1 and houseid=hd.houseid
(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