I know that Distinct isn't supposed to work in all situations, but I saw this posted by merlinofchaos, and I'm confused:

http://drupal.org/node/402360#comment-1422386
Sorry, it's whatever MySQL decides DISTINCT won't work on. I really don't understand why it doesn't work when it doesn't.

I have a situation where the following query works in phpMyAdmin:

SELECT DISTINCT users.uid AS uid,
   users.name AS users_name,
   users.picture AS users_picture
 FROM users users 
 LEFT JOIN flag_friend flag_friend ON users.uid = flag_friend.uid
 WHERE (users.status <> 0)
    AND ((users.uid = (SELECT f.friend_uid FROM flag_friend f WHERE f.uid = 3)) OR (users.uid IN (SELECT f.uid FROM flag_friend f WHERE f.friend_uid = 3)))

But when I set "Distinct" to Yes in Views, the DISTINCT statement never appears in the resulting sql, and i wind up with duplicates.

any ideas?

Comments

friolator’s picture

oh, and for what it's worth, we have avoided the 6.14 mess chronicled here: http://drupal.org/node/579892 -- so i don't think that applies to this situation.

We're on Drupal 6.13 and Views 6.x-2.x-dev (2009-Jul-26)

friolator’s picture

Version: 6.x-2.6 » 6.x-2.x-dev
esmerel’s picture

Status: Active » Closed (fixed)

General closing of issues with no activity for 6 months