0
我發現,MySql不支持連接中的相關查詢。是否有可能重寫提供(簡單)查詢保持邏輯?MySQL如何在連接中使用相關查詢
SELECT *
FROM tableX AS x
LEFT JOIN (
SELECT y.xFK, COUNT(y.id) AS y_count
FROM tableY AS y
WHERE y.xFK = x.id
GROUP BY y.xFK
) AS sub
ON sub.xFK = x.id
WHERE sub.y_count > 1
在此先感謝。