Ok
As a simple example, the table structures could be;
Bookstore Table
BookID (Primary Key)
BookTitle
Author
Pages
Published
ISBN_Number (No spaces are allowed in column names)
Description
Comments table
BookID (Foreign Key) (New Column )
CommentID
Comments
Author
CommentNumber (this column is not required)
the query to join these tables would be
Code:
SELECT BookID,BookTitle,b.Author,Pages,Published,ISBN_Number,Description,CommentID,Comments,c.Author FROM bookstore as b INNER JOIN comments as c ON b.BookID = c.BookID WHERE b.BookID = ID_For_requested_book ORDER BY CommentID DESC ;
no idea what database you are using but the above is plain ANSII SQL so should work on any DB Server
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|