inblog logo
|
silver
    SQL문제풀기

    [SQL문제풀기] 세 명이 서로 친구인 관계 찾기

    silver's avatar
    silver
    Oct 01, 2025
    [SQL문제풀기] 세 명이 서로 친구인 관계 찾기
    Contents
    문제 SQLite

    문제

    : 쿼리 실행에 오랜시간 소요
    solvesql.com
    solvesql.com
    https://solvesql.com/problems/friend-group-of-3/

    SQLite

    내가 작성한 정답

    select a.user_a_id, b.user_a_id user_b_id ,c.user_b_id user_c_id from edges a join edges b on a.user_b_id = b.user_a_id join edges c on a.user_a_id = c.user_a_id and b.user_b_id = c.user_b_id where 3820 in (a.user_a_id,b.user_a_id,c.user_b_id);
    Share article

    silver

    RSS·Powered by Inblog