MySQL Forums
Forum List  »  Optimizer & Parser

Re: Use of DISTINCT in INNER JOIN
Posted by: Steve Croall
Date: March 27, 2009 05:20AM

So, you are saying that when using DISTINCT I must have an index that includes all the columns I wish to return? The original query being used has about 15 columns in the table that need to be returned.

The JOIN statement could potentially bring back duplicate rows hence the need for DISTINCT.

If this is by design in MySQL, then fair enough, we will use an alternative query. I just wanted to check that this wasn't a bug, since this type of query doesn't show the same issue in Oracle or MSSQL.

Cheers, Steve.

Options: ReplyQuote


Subject
Views
Written By
Posted
70135
March 24, 2009 12:07PM
11262
March 24, 2009 02:00PM
6997
March 25, 2009 07:01PM
Re: Use of DISTINCT in INNER JOIN
6712
March 27, 2009 05:20AM
5926
March 27, 2009 10:01AM
6878
March 28, 2009 02:02AM
4752
March 28, 2009 03:53PM
5956
April 01, 2009 03:36AM
6235
April 02, 2009 12:16AM
5709
April 02, 2009 06:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.