RE: Problems with "select distinct"

2005-01-26 Thread Gustafson, Tim
) 908-4185 Fax http://www.meitech.com/ -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:08 AM To: Frederic Wenzel Cc: Gustafson, Tim; mysql@lists.mysql.com Subject: Re: Problems with "select distinct" Frederic Wenzel wrote

Re: Problems with "select distinct"

2005-01-25 Thread Michael Stassen
Frederic Wenzel wrote: On Tue, 25 Jan 2005 08:44:45 -0500, Michael Stassen <[EMAIL PROTECTED]> wrote: I suspect mysql is doing the DISTINCT before the ORDER BY. One of the reasons I avoid DISTINCT when possible. Isn't this supposed to be correct? Ordering has to take place as the very last operati

Re: Problems with "select distinct"

2005-01-25 Thread Frederic Wenzel
On Tue, 25 Jan 2005 08:44:45 -0500, Michael Stassen <[EMAIL PROTECTED]> wrote: > I suspect mysql is doing the DISTINCT before the ORDER BY. One of the > reasons I avoid DISTINCT when possible. Isn't this supposed to be correct? Ordering has to take place as the very last operation, after any sele

Re: Problems with "select distinct"

2005-01-25 Thread Michael Stassen
I suspect mysql is doing the DISTINCT before the ORDER BY. One of the reasons I avoid DISTINCT when possible. Try: SELECT Documents.ID, Name FROM Documents, DocumentFiles, DownloadLog WHERE Documents.ID = DocumentFiles.Document AND DocumentFiles.ID = DownloadLog.DocumentFile GROUP B