Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql plus more than one table

Status
Not open for further replies.

ggreg

Programmer
Mar 9, 2001
201
US
I have tables books, bookauthor, Author, and Publisher
in books I have isbn, title and pubID
in bookauthor I have isbn and AuthorID
in Author I have AuthorID, Lname, Fname
in Publisher I have PubID and name

I need an sql that will show the book title, Author Fname and Lname and the Publisher name

what I have and it does not work is

select title, Fname, Lname, name
from books natural join bookauthor natural join author
/

can some one help me work this out?
thanks
 
select title, Fname, Lname, name
from books b, bookauthor ba, author a, publisher p
where b.pubID = p.pubid and b.isbn = ba.isbn
and ba.authorid = a.authorid


-------------------------
The trouble with doing something right the first time is that noboby appreciates how difficult it was.
- Steven Wright
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top