此查询根本没有显示任何内容。我只想要那些在子查询中匹配的 ORDERNO 的结果。
SELECT SUM(STY.NQTY * STY.NUNITPRICE
/ 1000) AS ORDERAMOUNT,
(SELECT SUM(TBLORDERSTYLE.NQTY * TBLORDERSTYLE.NUNITPRICE/1000) FROM TBLORDER
INNER JOIN TBLORDERSTYLE
ON TBLORDER.CORDERNO = TBLORDERSTYLE.CORDERNO
WHERE TBLORDER.CLCNO LIKE '%MR#%' AND
TBLORDER.CORDERNO = ORD.CORDERNO
GROUP BY ORD.CORDERNO) AS K
FROM TBLORDER ORD INNER JOIN
TBLORDERSTYLE STY ON
ORD.CORDERNO = STY.CORDERNO
where (ORD.NPOSTFLAG = '1') AND
(ORD.NCANCEL = '0') AND
ORD.NPAYMODE = '1' AND
(ORD.DPICONFIRMDATE BETWEEN
TO_DATE('01-JUL-2012')AND TO_DATE('31-JUL-2012'))