RE: Erroneus column using MAX() and GROUP BY

2005-03-18 Thread Elton Clark
- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 12:17 AM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: Erroneus column using MAX() and GROUP BY You've misunderstood how GROUP BY and MAX() work. GROUP BY divides your data into groups, and aggr

Re: Erroneus column using MAX() and GROUP BY

2005-03-16 Thread Michael Stassen
You've misunderstood how GROUP BY and MAX() work. GROUP BY divides your data into groups, and aggregate functions such as MAX() tell you something about each group, but they *do not* return *rows* from your table. Consider the following example rows in a larger table: cat val1 val2 4

Erroneus column using MAX() and GROUP BY

2005-03-16 Thread Daevid Vincent
I have this table: mysql> select historyvlan_time, historyvlan_vlan, v.clienthistory_id from pe_historyvlan as v join pe_clienthistory using (clienthistory_id) order by historyvlan_vlan, historyvlan_time desc; +--+--+--+ | historyvlan_time | history