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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL query for available books

Status
Not open for further replies.

DonyBoy

MIS
Apr 22, 2005
26
GB
I have 2 tables for a library.
Table1: has the book details with the book-number being the primary key

Table2: has the details of borrowed books. This table also has the column book-number- linked to Table1, using the same column.

I need to make an SQL query that gives the list of AVAILABLE books (IN OTHER WORDS, REMOVING THE BORROWED BOOKS). How do I do this?
 
Simply follow the unmatched query wizard.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You don't know how to follow a query wizard ?

Anyway, a starting point (SQL code):
SELECT Table1.*
FROM Table1 LEFT JOIN Table2 ON Table1.[book-number] = Table2.[book-number]
WHERE Table2.[book-number] Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top