Connecting Tech Pros Worldwide Forums | Help | Site Map

How to build a query based on four tables

Newbie
 
Join Date: Jun 2009
Posts: 3
#1: Jun 30 '09
hi , I was wondering if anyone might be able to determine a query based on these tables :I've created a database using sql server express 2005 of 4 tables :"BOOKS , AUTHORS , CATEGORIES and PUBLISHERS ".

I have to show what every author has in terms of books .
and I cant figure out how to do that !!!!
I want it to look somth like this:

author : elieeee
-----------------------------------------
book category book title
-----------------------------------------
comedy love
action woooow
drama I hate u



I appreciate any help possible :D
btw this is the query that i've use :""SELECT DISTINCT [category], [title] FROM [books] ORDER BY [title], [category] GROUP BY [ Author Name ]

ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#2: Jun 30 '09

re: How to build a query based on four tables


Yes. Use JOIN.

Good luck

--- CK
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,748
#3: Jun 30 '09

re: How to build a query based on four tables


Try a Google search for some tutorials.

See if you can make it work.
Let us know if you run into any problems with it.

P.S. we like code examples and error messages ;-)
Reply