체크 리스트

동욱

(댓글 수에 대댓글 수도 반영해야함)

기탁

13 Pro - 23.png

회원가입

입력 데이터


13 Pro - 4.png

홈 화면(동욱)

출력 데이터

입력 데이터

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;