oracle中

select tmp_tb.*, ROWNUM row_id
from (SELECT MX.*                                          --这里不能直接用*,否则报错。
FROM HX_FP.FP_LY_MX MX, HX_FP.FP_LY ZB, HX_DJ.DJ_NSRXX NSR
WHERE MX.FPLYUUID = ZB.FPLYUUID
AND ZB.DJXH = NSR.DJXH
AND NSR.NSRSBH = '362227197511100131'
AND MX.LRRQ >= DATE '2017-07-05'
AND MX.LRRQ < DATE '2017-07-05' + 1) tmp_tb

 

select tmp_tb.*, ROWNUM row_id
from (SELECT *                                          --这里报错。这里应该写具体字段
FROM HX_FP.FP_LY_MX MX, HX_FP.FP_LY ZB, HX_DJ.DJ_NSRXX NSR
WHERE MX.FPLYUUID = ZB.FPLYUUID
AND ZB.DJXH = NSR.DJXH
AND NSR.NSRSBH = '362227197511100131'
AND MX.LRRQ >= DATE '2017-07-05'
AND MX.LRRQ < DATE '2017-07-05' + 1) tmp_tb

posted @ 2018-04-08 14:13  神只吃苹果  阅读(169)  评论(0编辑  收藏  举报