Hi all, I have a query which is selecting DISTINCT sizes from my database only it doesn’t seem to be returning DISTINCT sizes. My query is below along with a screen grab of what the query is returning. Appreciate any help
SELECT DISTINCT sizes FROM products AS p LEFT JOIN
products_to_section as o ON p.id=o.prod_id WHERE o.section_name='all-accessories'
AND p.live='1'
Hey bud, you were absolutely correct, there was a few nasty spaces on the sizes, very annoying. Gone through them all now and removed any spaces and all is working perfectly. I’ll be sure to use the PHP trim function next time to strip any spaces.
Right ok, I’ll take a look into using INNER JOIN. Thanks for the pointer