inblog logo
|
stupefyee
    SQL문제풀기

    [SQL 문제 풀이] 재구매가 일어난 상품과 회원 리스트 구하기

    Stupefyee's avatar
    Stupefyee
    Nov 17, 2024
    [SQL 문제 풀이] 재구매가 일어난 상품과 회원 리스트 구하기
    notion image
    💡
    SELECT user_id, product_id FROM online_sale GROUP BY user_id , product_id HAVING COUNT(*) > 1 ORDER BY user_id ASC , product_id DESC;
    GROUP BY를 활용해 중복을 처리
     
    Share article

    stupefyee

    RSS·Powered by Inblog