한방쿼리

[Database/MySQL] Youtube 유튜브 한방쿼리 작성
MySQL + Node.js로 Youtube를 따라 만들며 공부했을 때 직접 설계했던 ERD이다. 💡 영상 조회 select v.videoName, v.videoPlus, u.userName, up.userProfile, # (select count(vv.videoViewIdx) as viewNum # from videoview vv left join video v on vv.videoIdx = v.videoIdx # group by v.videoIdx) as viewNum, # 조회수 ifnull(vieww.viewNum, 0) as viewNum, (select count(subUserIdx) from subscription s group by s.userIdx having s.userIdx = ?)..