SELECT M.NURSE,OSCD.CLASS_NAME,M.ADNAME,M.CNT FROM MOBILE.ORDER_SUB_CLASS_DICT OSCD, (SELECT OE.EXECUTE_NURSE NURSE,OE.ADMINISTRATION ADNAME,COUNT(*) CNT FROM MOBILE.ORDERS_EXECUTE OE ,ADMINISTRATION_DICT AD WHERE OE.IS_EXECUTE='1' AND TO_DATE(TO_CHAR(OE.EXECUTE_DATE_TIME,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')>=TO_DATE('2010-10-08 00:00:00','YYYY-MM-DD HH24:MI:SS') AND TO_DATE(TO_CHAR(OE.EXECUTE_DATE_TIME,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')<=TO_DATE('2015-10-08 00:00:00','YYYY-MM-DD HH24:MI:SS') AND OE.WARD_CODE='1001N' AND OE.ADMINISTRATION = AD.ADMINISTRATION_NAME AND AD.CLASS_ID=1 GROUP BY OE.EXECUTE_NURSE,OE.ADMINISTRATION) M WHERE OSCD.CLASS_ID=1
网上说需改成内联查询,尝试多次失败,只能求救于各位大神,谢谢。