多个表,部分字段相同。union查询后,分页。
如 orderA:order_id order_type user_name
   orderB:order_id order_type sys_time
   orderC:order_id order_type buz_type
orderA、orderB、orderC 联合查询之后要分页 只查询他们相同的字段 order_id 和 order_type

解决方案 »

  1.   

    select order_id,order_type from orderA
    union all
    select order_id,order_type from orderB
    union all
    select order_id,order_type from orderC
    之后怎么分页?
      

  2.   


    select t2.* from (select t1.*,rownum rnum from 
    (
    select order_id,order_type from orderA
    union all
    select order_id,order_type from orderB
    union all
    select order_id,order_type from orderC
    ) t1 )t2 where t2.rnum>1 and t2.rnum<10注:
    t2.rnum>1 and t2.rnum<10 其中的1和10是穿过来的可变参数
    如果有不懂的可以再问我……