If you have a unique constraint on the field, you can use FetchUsingUCXYZ. SELECT DISTINCT will return only the distinct combination of all columns on the query. It may have seemed to work because you only have unique values in your table.
If you actually need a field to be unique/distinct, you need to use a constraint.
Basically I want to return all unique entities based on a field.
DISTINCT is applied on all the fields in the select list, not on one field.
I don't understand what you are trying to do.
Please post an example. post a table design schema, and a sample of rows data, and last but not least the query that you want to execute.