Oracle数据库和DB2数据库分页SQL的区别举例

--------------------------ORACLE数据库分页SQL举例------------------------------------------------
SELECT *
FROM (
SELECT TEMP.*, ROWNUM AS NUM
FROM (
SELECT EB.EHR_ID,EB.PERSON_NAME,CL.SVC_ID a,BILL.SVC_ID b,BILL.ITEM_NAME
FROM PHIS.EHR_BASE EB, PHIS.SVC_CLINIC CL,PHIS.SVC_CLINIC_BILL BILL
WHERE EB.EHR_ID = CL.EHR_ID
AND CL.SVC_ID = BILL.SVC_ID
) TEMP
)
WHERE NUM <= 5
AND NUM > 0
--------------------------DB2数据库分页SQL举例---------------------------------------------------
SELECT *
FROM (
SELECT TEMP.*, ROW_NUMBER() OVER() AS NUM
FROM (
SELECT EB.EHR_ID,EB.PERSON_NAME,CL.SVC_ID a,BILL.SVC_ID b,BILL.ITEM_NAME
FROM PHIS.EHR_BASE EB, PHIS.SVC_CLINIC CL,PHIS.SVC_CLINIC_BILL BILL
WHERE EB.EHR_ID = CL.EHR_ID
AND CL.SVC_ID = BILL.SVC_ID
) TEMP
)
WHERE NUM <= 5
AND NUM > 0
-------------------------------------------------------------------------------------------------
上一篇:质量管理:PDCA循环


下一篇:从Openvswitch代码看网络包的旅程