一共四个表,俩个问题
select count(*) from aaunion
select count(*) from bbunion
select count(*) from ccunion
select count(*) from dd;第一个难题
我想看这四个表都有多少条数据,这样显示
aa  bb  cc  dd
2   34  45  2
第二个难题
我想看这四个表中都是什么数据,也就是说,把这四个表的所有数据都显示出来。
谁能回答我的问题,我算谁厉害!!

解决方案 »

  1.   

    第一个:
    select 
    (select count(*) from aaunion) aa,
    (select count(*) from bbunion) bb,
    (select count(*) from ccunion) cc,
    (select count(*) from dd ) dd
    from dual
    第二个楼主要怎么显示?
      

  2.   

    你用plsql的话直接
    select * from aa;
    select * from bb;
    select * from cc;
    select * from dd;
    就可以分页显示了。
    你四个表如果表结果不一样的话不可能用一条语句就可以显示四张表的。
      

  3.   

     select aa.*, bb.*, cc.*, dd.*
                from (select rownum ai, a.* from a) aa,
                     (select rownum bi, b.* from b) bb,
                     (select rownum ci, c.* from c) cc,
                     (select rownum di, d.* from d) dd
               where aa.ai = bb.bi(+)
                 and aa.ai = cc.ci(+)
                 and aa.ai = dd.di(+)
      

  4.   

    select 
    (select count(*) from aaunion) aa, 
    (select count(*) from bbunion) bb, 
    (select count(*) from ccunion) cc, 
    (select count(*) from dd ) dd 
      

  5.   

    就你牛比,你也初学的时候,YY个毛YY。