SELECT buyplan.buyPlanNo,handState,buyplan.unitNo,buyplan.ownNo,ownof.ownName,
unit.unitname,goodsNo,buyTypeNo,buyWayNo,goodsName,onePrice,calculateUnit,buyCount,
totalPrice,technologyIndex,operatePeople,newAddTime,newAddPeople,updateTime,updatePeople,
groupNo,thisBuyBudget,buyReportState
FROM (SELECT ROWNUM rn,buyPlanNo,unitNo,ownNo,goodsNo,buyTypeNo,buyWayNo,goodsName,
onePrice,calculateUnit,buyCount, totalPrice,technologyIndex,operatePeople,
newAddTime,newAddPeople,updateTime,updatePeople, groupNo,thisBuyBudget,buyReportState
FROM g3_buyplan WHERE 1=1 ) buyplan,g3_process process,g3_unit unit,g3_ownoffice ownof
WHERE buyplan.unitno=unit.unitno AND buyplan.ownno=ownof.ownno AND buyplan.buyplanno=process.buyplanno
AND rn > 0 AND rn <= 10 AND handstate = 2
字段有点多,不过前面的那些个字段大神们可以忽略,主要是最后那句话:
“AND rn > 0 AND rn <= 10”这句是用来做分页查询的,在这写上这个就什么也查不出来,删掉它就能查出数据。是位置写错了么?