Connecting Tech Pros Worldwide Help | Site Map

How to build a query based on four tables

  #1  
Old June 30th, 2009, 09:03 AM
Newbie
 
Join Date: Jun 2009
Posts: 3
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 ]
  #2  
Old June 30th, 2009, 09:15 PM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,914
Provided Answers: 1

re: How to build a query based on four tables


Yes. Use JOIN.

Good luck

--- CK
  #3  
Old June 30th, 2009, 09:24 PM
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,701
Provided Answers: 4

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i write Set based queries and avoid a cursor? CK answers 36 October 9th, 2008 06:25 PM
General question to other developers... RvGrah answers 40 January 20th, 2008 06:55 PM
Laws and Myths of Usability & Interface Design YellowFin Announcements answers 0 December 12th, 2006 10:55 AM
Two Table Loop - Assigning Names to Records JC answers 2 November 12th, 2005 07:18 PM