Query second table based on first query response?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    #1

    Query second table based on first query response?

    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:
    Code:
    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
  • ziycon
    Contributor
    • Sep 2008
    • 384

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

    Comment

    Working...