커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
4-2
[왕초보] 엑셀보다 쉬운, SQL
4주차
북마크
노*지
댓글
1
추천
0
조회수
10
조회수
10
답변 완료

1.강의에서 where절을   where user_id = c.user_id 요렇게 알려주셨는데   where c.user_id = user_id 요렇게 써도 같은 결과가 나오더라구요

= 같다라는 의미니깐 순서는 상관이 없나요?


select c.checkin_id, 

    c.user_id, 

    c.likes,

    (select avg(likes) from checkins 

    where user_id = c.user_id

    ) as avg_likes

from checkins c


select c.checkin_id, 

    c.user_id, 

    c.likes,

    (select avg(likes) from checkins 

    where c.user_id = user_id

    ) as avg_likes

from checkins c






취소
 공유
취소
댓글 0
댓글 알림
나의얼굴