ccDan - 6:05 pm on Jun 13, 2010 (gmt 0)
I am trying to do a search across two tables and not having much success.
Here are essentially what the tables are like:
Table 1: animals
Fields: name, description, imageURL
Table 2: states
Fields: state, name
In table 2, you would have entries like this:
What I want to do is select two states and list the animals that are in those two states, but listing each animal only once.
My latest attempt is this:
WHERE states.area = 'WA' OR states.area = 'OR'
AND animals.name = states.name
ORDER BY animals.name ASC
What I keep getting, through my various attempts, is a list of all animals in all states, including animals that are not listed in any states.
I've tried several variations on the search string, and keep ending up getting nowhere, which is a real head-scratcher because, believe it or not, I usually don't have this much of a problem setting up search strings.
I'm hoping I'm just forgetting something really, really simple. Any ideas?