求 oracle union查询 分页

myfuturein 2011-07-11 03:23:58
多个表,部分字段相同。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
...全文
218 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
感谢楼上的楼上
myfuturein 2011-07-11
  • 打赏
  • 举报
回复
呵呵 如果图片是你的果断分全给
ChiChengIT 2011-07-11
  • 打赏
  • 举报
回复
我比楼主回复你帖子就慢5s啊
ChiChengIT 2011-07-11
  • 打赏
  • 举报
回复

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是穿过来的可变参数
如果有不懂的可以再问我……
myfuturein 2011-07-11
  • 打赏
  • 举报
回复
自己解决了 请勿回
myfuturein 2011-07-11
  • 打赏
  • 举报
回复
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
之后怎么分页?

3,491

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧