List:General Discussion« Previous MessageNext Message »
From:Machiel Richards Date:November 8 2013 11:35am
Subject:Re: Mysql 5.1 union with group by for results
View as plain text  
Happiness, that gave me what I was looking for. Thank you Johan.

I have tested the option you gave me but my brackets was in the wrong place.




On 08/11/2013 13:23, Johan De Meersman wrote:
> ----- Original Message -----
>> From: "Machiel Richards" <machiel.richards@stripped>
>>
>> ERROR 1064 (42000): You have an error in your SQL syntax; check the
>> manual that corresponds to your MySQL server version for the right
>> syntax to use near 'GROUP BY t.AccountID,
>
> I suspect your query has never been doing what you think at all, and you need to
>
>
>    select [fields] from (
>      select fields1 blahblah
>      UNION
>      select fields2 blahblah) unionized
>    group by blurb
>
>
> that is, wrap the entire union in a virtual table and do the group by on that.
>
>

Thread
Mysql 5.1 union with group by for resultsMachiel Richards8 Nov
  • Re: Mysql 5.1 union with group by for resultsJesper Wisborg Krogh8 Nov
    • Re: Mysql 5.1 union with group by for resultsMachiel Richards8 Nov
Re: Mysql 5.1 union with group by for resultsJohan De Meersman8 Nov
  • Re: Mysql 5.1 union with group by for resultsMachiel Richards8 Nov