left join (select a.dish_id, count(b.comment_heart) sl
from jw_order_arch a, jw_comment b
where b.single_order_id = a.single_order_id
group by a.dish_id) comments
on comments.dish_id = a.dish_id ------解决方案--------------------
SELECT A.DISH_NAME, NVL(COMMENTS.SL, 0) PINGLUN
FROM (SELECT DISH_NAME, DISH_ID FROM JW_DISH) A,
(SELECT A.DISH_ID, COUNT(B.COMMENT_HEART) SL
FROM JW_ORDER_ARCH A, JW_COMMENT B
WHERE B.SINGLE_ORDER_ID = A.SINGLE_ORDER_ID
GROUP BY A.DISH_ID) COMMENTS
WHERE COMMENTS.DISH_ID = A.DISH_ID(+)
------解决方案-------------------- 左连接 应该就这两种了left join on ,(+)