1 select max(ta.aa) AA,max(tb.dd)||
2 decode(max((select count(tb1.aa) from tb tb1 where tb1.aa=ta.aa group by tb1.aa)),1,' ','等') D
3 from ta,tb
4 where tb.aa=ta.aa
5* group by ta.aa
SQL> /
select max(ta.aa) AA,max(tb.dd)||
decode(max((select count(tb1.aa) from tb tb1 where tb1.aa=ta.aa group by tb1.aa)),1,' ','等') D
from ta,tb
where tb.aa=ta.aa
group by ta.aa
/
已用时间: 00: 00: 00.00
17:05:13 SQL> select aa,dd from
17:05:24 2 (select aa,decode((select count(*) from b d where d.aa=c.aa),1,dd,
dd||'等') dd from b c) a
17:05:24 3 where rowid=(select min(rowid) from b where a.aa=b.aa);