Connecting Tech Pros Worldwide Help | Site Map

Query second table based on first query response?

Familiar Sight
 
Join Date: Sep 2008
Posts: 252
#1: May 14 '09
Ok, i got the main query working, my issue is that the GROUP BY isn't working, its should only show one of each location:
Expand|Select|Wrap|Line Numbers
  1. SELECT _teamdb_country.name FROM _teamdb, _teamdb_country WHERE _teamdb.country NOT IN (0) AND _teamdb.country = _teamdb_country.id ORDER BY _teamdb_country.name ASC
It should look like:
France
Germany
UK

But its outputting this:
France
Germany
Germany
UK
UK
UK
Familiar Sight
 
Join Date: Sep 2008
Posts: 252
#2: May 14 '09

re: Query second table based on first query response?


Sorted, I was using an ORDER BY instead of a GROUP BY.
Reply