炸裂这一步想必大家都会把,我就省去了。。 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

相关推荐

点赞 评论 收藏
分享
粗心的雪碧不放弃:纯学历问题,我这几个月也是一直优化自己的简历,后来发现优化到我自己都觉得牛逼的时候,发现面试数量也没有提升,真就纯学历问题
点赞 评论 收藏
分享
牛客网
牛客企业服务