Click to See Complete Forum and Search --> : Need help joining table results


tagriffith
05-10-2005, 02:26 PM
Hello,

Can anyone help me figure out how to join two tables within the same database?

I have a database setup where I am trying to give residents in the area, local recycling drop-off locations.

I had to use longitude and latitude to accomplish a zipcode radius. That table works great. I get the area zipcodes in a radius.

Now I have another table in the database that has all the locations. How do I use the first database to get the radius results (which is working), but then display the results from the location table? Not all zipcodes have a location. I only want to show the zipcodes that have a location, but I have to have all the zipcodes in the database for the radius comparision.

Thanks for the help.

wmif
05-10-2005, 03:58 PM
select [columns] from locationtable where location.zip in (select zip from ziptable where zip = 'somevariable')

tweak it to how you need it.

tagriffith
05-11-2005, 10:09 AM
Thanks! wmif that works!