Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Selecting Rows From One Table With A Key That Doesn't Exist In Another.


I'm trying to select rows from one table that does not have a key in another table.

For instance:

I have a hospital table with two columns, id and name.

I have a patients table with three columns, id, name, and locationid.

Now I want to find those hospitals that have no patients. So I want to get those hospitals whos id does not equal any of the locationid's in the patients table.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

    Copyright © 2005-08 www.BigResource.com, All rights reserved