您的位置:首页 > 数据库 > Oracle

oracle12c JSON数据 使用SQL语句实现多表左外连接 显示无效数据 分页查询

shuguang_2008 2015-09-07 17:08 225 查看
SQL代码如下:

SELECT *
FROM (SELECT oo.*, ROWNUM AS rowno
FROM(SELECT o.DATA.orderNo, os.DATA.name as orderSource,bu.DATA.name as businessType, o.DATA.customNo, o.DATA.productName, o.DATA.contactTel,
o.DATA.loadTime, o.DATA.loadPlace, o.DATA.deliverTime, o.DATA.deliverPlace, ar.DATA.name as area,
o.DATA.others, cu.DATA.customName, cs.DATA.name as customSource, cu.DATA.contactWay, cu.DATA.customUnit
FROM GJ_WULIIU_ORDER o, GJ_WULIU_CUSTOMER cu,GJ_WULIU_ORDERSOURCE os,gj_wuliu_busitype bu,gj_wuliu_custsource cs,gj_wuliu_area ar
WHERE o.DATA.customNo= cu.DATA.customNo(+)
AND o.DATA.orderSource=os.DATA.code(+)
AND o.DATA.businessType=bu.DATA.code(+)
AND cu.DATA.customSource=cs.DATA.code(+)
AND o.DATA.area=ar.DATA.code(+)
ORDER BY o.DATA.orderNo DESC
) oo
WHERE ROWNUM <= pageBean.getCurrentPage()*pageBean.getPageSize()) table_alias
WHERE table_alias.rowno >= (pageBean.getCurrentPage()-1)*pageBean.getPageSize();


以上代码仅供参考,谢谢!
标签: