MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Roger Baklund Date:February 17 2005 3:01pm
Subject:Re: Subquery problems
View as plain text  
Roger Baklund wrote:
> Try something like this:
> 
> SELECT ID,NAME,COUNT(*)
>   FROM tableA
>   LEFT JOIN tableB ON
>     tableA.ID = tableB.ID
>   GROUP BY ID,NAME

Nope, sorry, that won't work, ID exists in both tables thus it must be 
prefixed with table name or alias: SELECT tableA.ID,... GROUP BY 
tableA.ID,...

But Shawn Green allready gave you the answer, so I suppose you are in 
control of things. :)

-- 
Roger

Thread
Subquery problemsJoppe A17 Feb
  • Re: Subquery problemsSGreen17 Feb
  • Re: Subquery problemsRoger Baklund17 Feb
    • Re: Subquery problemsRoger Baklund17 Feb