炸裂这一步想必大家都会把,我就省去了。。 WITH t AS ( SELECT 'A' AS fr,'B' as too UNION ALL SELECT 'A' ,'C' UNION ALL SELECT 'A' ,'E' UNION ALL SELECT 'B' ,'A' UNION ALL SELECT 'B' ,'F' UNION ALL SELECT 'B' ,'E' UNION ALL SELECT 'C' ,'E' UNION ALL SELECT 'C' ,'F' UNION ALL SELECT 'C' ,'A' ) select concat(t1.fr,'-',t2.fr) as who_and_who,collect_set(t1.too) as comment_love from ( select fr, too, cn from ( select fr, too, count(fr) over (partition by too) as cn from t ) temp where cn > 1 ) t1 join ( select fr, too, cn from ( select fr, too, count(fr) over (partition by too) as cn from t ) temp where cn > 1 ) t2 on t1.fr <t2.fr and t1.too = t2.too GROUP BY concat(t1.fr,'-',t2.fr)
点赞 1

相关推荐

10-28 10:48
已编辑
门头沟学院 Java
孩子我想要offer:发笔试后还没笔试把我挂了,然后邮箱一直让我测评没测,后面不知道干嘛又给我捞起来下轮笔试,做完测评笔试又挂了😅
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务