cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to find unique results in flexible query, if you have multiple records with same attribute value.

Former Member
0 Likes
3,036

Lets say i have 4 products two products with same name "test" and another two products with name "test1". I want a flexible query which will return two records i.e if duplicate records found then only one of them should be returned.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Hi, You can use DISTINCT keyword in the flexible query for getting unique results. Example : "SELECT DISTINCT {p.name} from {Product as p}

Thanks, Ram

Former Member
0 Likes

As per my understanding what you can do is, you can get all the products using flexible search and then can filter out the results by taking into account java.util.Set for your requirement.