WITH DATA1 AS
(
SELECT 5175133 ID,'Yun' FIRST_NAME,'Yue' LAST_NAME,NULL MASTER_ID FROM dual UNION ALL
SELECT 5157093,'Yun','Yue',5157093 FROM dual UNION ALL
SELECT 5226656,'Yun','Yue',NULL FROM dual UNION ALL
SELECT 6345852,'Yun','Yue',5157093 FROM dual UNION ALL
SELECT 5882603,'Ye','Han',5157093 FROM dual UNION ALL
SELECT 5902219,'Ye','Han',5157093 FROM dual UNION ALL
SELECT 6362890,'Rick','Kaylor',NULL FROM dual UNION ALL
SELECT 6362940,'Rick','Kaylor',NULL FROM dual UNION ALL
SELECT 5215659,'Rick','Kaylor',NULL FROM dual UNION ALL
SELECT 5962837,'Rick','Kaylor',5962837 FROM dual UNION ALL
SELECT 5841556,'Rick','Kaylor',5841556 FROM dual UNION ALL
SELECT 5916218,'Sherlene','Heard',5916218 FROM dual UNION ALL
SELECT 6356086,'Sherlene','Heard',5916218 FROM dual UNION ALL
SELECT 5885157,'Ye','Kong',5884937 FROM dual UNION ALL
SELECT 5884937,'Ye','Kong',NULL FROM dual UNION ALL
SELECT 5898890,'Ye','Kong',5884937 FROM dual
)
SELECT * FROM DATA1
我认为它的简单查询请提供帮助? 感谢
答案 0 :(得分:1)
因为这很可能是某种家庭作业或作业,只是一个线索:
您是否考虑过在子查询中使用COUNT(*)
?据我所知,“正确掌握的收件人”将只有一个master_id
......