Re: Aggregate functions in ORDER BY

2006-03-09 Thread Yasir Assam
Thanks for that Nicolas. Yasir Can you run without the Order By at all? If not, you may need to properly join the tables. I could reproduce the issue with MySQL 4.1 as well and I would go around it myself by creating a temporaty table, populating it with the aggregate, doing a select on the te

Re: Aggregate functions in ORDER BY

2006-03-09 Thread Yasir Assam
sday, March 08, 2006 11:10 PM To: Dave Pullin Cc: mysql@lists.mysql.com Subject: Re: Aggregate functions in ORDER BY Many thanks for that Dave. Do you know whether it's possible for MySQL to return fully qualified column names by default? For example, I'd like

RE: Aggregate functions in ORDER BY

2006-03-09 Thread Dave Pullin
lto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 11:10 PM To: Dave Pullin Cc: mysql@lists.mysql.com Subject: Re: Aggregate functions in ORDER BY Many thanks for that Dave. Do you know whether it's possible for MySQL to return fully qualified column names by default? For ex

RE: Aggregate functions in ORDER BY

2006-03-08 Thread Nicolas Verhaeghe
Can you run without the Order By at all? If not, you may need to properly join the tables. I could reproduce the issue with MySQL 4.1 as well and I would go around it myself by creating a temporaty table, populating it with the aggregate, doing a select on the temp table and then of course droppin

Re: Aggregate functions in ORDER BY

2006-03-08 Thread Yasir Assam
Many thanks for that Dave. Do you know whether it's possible for MySQL to return fully qualified column names by default? For example, I'd like select * from foo; to return ++--+ | foo.a | foo.b| ++--+ | 1 | Rex | | 2 | Buddy| | 3

RE: Aggregate functions in ORDER BY

2006-03-08 Thread Dave Pullin
All you are doing when you quote the expression like `COUNT(pets.pet_id)` is referencing the column in the select by its default column name (which is the same as the expression.) That's why it only works when the expression is a column. If you dont want the order by column to appear in the result