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

Problem with OUTER JOIN

Status
Not open for further replies.

gradinumcp

IS-IT--Management
Apr 6, 2005
85
US
Hi! I have 2 tables with the corresponding columns:

1) InventoryComputers-ComputerID, ComputerSN.
2) InventoryStations-Autonum, BranchID, StationID, ComputerID.

I want to display all rows of InventoryComputers for which the ComputerID does not have an entry in InventoryStations.
So basically, I want to display those computers that do not have a station assigned to them.

I tried this sql statement, but it also displays those rows that are present in InventoryStations table, which I don't want.


SELECT * FROM InventoryComputers
LEFT OUTER JOIN InventoryStations on InventoryStations.ComputerID=InventoryComputers.ComputerID
ORDER BY InventoryComputers.ComputerID


Any ideas what is wrong??

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top