Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- B.bid AS _bookId,
- B.bname AS _bookName,
- W.wid AS _writerId,
- W.wname AS _writerName,
- C.cid AS _commentId,
- C.comment AS COMMENTS,
- C.DATE AS _commentDate,
- U.uname AS _userName,
- U.uid AS _userID
- FROM books_writers AS BW
- JOIN books AS B ON B.bid = BW.bid
- JOIN books_writers AS BW1 ON B.bid = BW1.bid
- JOIN writers AS W ON BW1.wid = W.wid
- LEFT JOIN comments AS C ON C.bid = BW1.bid
- LEFT JOIN users AS U ON U.uid = C.uid
- WHERE B.bid=?
- ORDER BY _commentDate DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement