I am facing a weird issue with MySQL Distinct clause. I am trying Distinct with inner join but the same term name and object_is is repeated. I want that same name or object_id not repeated.
Edit
In terms table name is repeated and in term_relations terma_taxonomy_id and object is repeated, i want that these values not repeat.
Note: I am working in wordpress
Here is my code:
Select Distinct wTerm.*, wTermTax.*, wTermRel.*
From wp_terms As wTerm
Inner Join wp_term_taxonomy As wTermTax
On wTerm.term_id = wTermTax.term_id
Inner Join wp_term_relationships As wTermRel
On wTermTax.term_taxonomy_id = wTermRel.term_taxonomy_id
Where wTermRel.object_id In(140,99,89,87,58)
And wTermTax.taxonomy = 'pa_garment-type'
How can i achieve this.