troubleshooting Question

MySQL Select distinct query problem

Avatar of GamesNET2
GamesNET2Flag for United Kingdom of Great Britain and Northern Ireland asked on
MySQL Server
7 Comments1 Solution394 ViewsLast Modified:
Hi there,

I have the code below - when I run it it does not give me a DISTINCT list of 'title', however if i take away col_id_6 then it works,

Any ideas?


SELECT DISTINCT exp_channel_titles.title, exp_matrix_data.col_id_5
FROM exp_channel_titles
LEFT JOIN exp_channel_data ON exp_channel_titles.entry_id = exp_channel_data.entry_id 
LEFT JOIN exp_relationships ON exp_channel_data.entry_id = exp_relationships.rel_child_id
LEFT JOIN exp_relationships AS exp_rel ON exp_rel.rel_child_id = exp_relationships.rel_parent_id
LEFT JOIN exp_matrix_data ON exp_rel.rel_parent_id = exp_matrix_data.entry_id
WHERE exp_channel_data.channel_id = 1 AND exp_matrix_data.col_id_5 IS NOT NULL
ORDER BY exp_matrix_data.col_id_5 ASC
LIMIT 0, 10

Open in new window

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros