동욱
(댓글 수에 대댓글 수도 반영해야함)
기탁
[x] 홈 화면
[x] 포럼
[x] 홈에서 분야 클릭시
[x] 포럼 글쓰기
[x] 홈에서 책 클릭시
[x] 북클럽/챌린지 리스트
[x] 포럼 목록
[x] 북클럽/챌린지 정보
[x] 사용자 활동
[x] 북클럽/챌린지 게시판
[x] 사용자 포럼 활동(거의다함)
[x] 북클럽/챌린지 개설
[x] 사용자 북클럽/챌린지 활동
[x] 사용자 정보
[x] 사용자 북마크 현황
입력 데이터
출력 데이터
입력 데이터
select cover, title, author,
if(countPost is null, 0, countPost) as countPost,
if(countForum is null, 0, countForum) as countForum
from book as b
left join (select bookIdx,count(*) as countPost
from post
where status = 'RECRUITING'
group by bookIdx) as p on b.bookIdx = p.bookIdx
left join (select bookIdx,count(*) as countForum
from forum
group by bookIdx) as f on b.bookIdx = f.bookIdx
where b.status = 'ACTIVE'
order by b.createdAt desc;
select cover, keywords, title, authors,
if(countPost is null, 0, countPost) as countPost,
if(countForum is null, 0, countForum) as countForum
from book as b
left join (select bookIdx, count(*) as countPost
from post
where status = 'RECRUITING'
group by bookIdx) as p on b.bookIdx = p.bookIdx
left join (select bookIdx, group_concat(author) as authors
from bookauthor
group by bookIdx) as ba on b.bookIdx = ba.bookIdx
left join (select bookIdx, count(*) as countForum
from forum
group by bookIdx) as f on b.bookIdx = f.bookIdx
left join (select bookIdx, group_concat(keyword) as keywords
from bookkeyword
group by bookIdx) as bk on b.bookIdx = bk.bookIdx
where b.status = 'ACTIVE' and instr(keywords, ?) > 0;