Count of distinct values

Hi, I appreciate this topic was raised a couple of times a few years ago, but I am just wondering if there has been any updated solution.

I know there currently isn’t a DISTINCT function, but is there another way to get the total count of unique values in a column? I have tried to get round it using subqueries, but they don’t seem to work with aggregate functions.

I saw you released a DISTINCT flag in the codeless build section, but I was wondering if there is anything similar we are able to use to query the data?

My App ID is here: 75886AB4-31F2-10EB-FF25-CAAC43341200
I’m trying to get a total count of Company.Name while querying the Contacts Table (as all our primary filtering criteria runs through there on our application)

Thanks,

Zaf

Hello, @Zaf_Kassam and welcome to our community and thank you for trying out Backendless.

If you need to get unique records from a table, you can use DISTINCT, like this:
COUNT(distinct Company.Name)

Best regards, Nikita.

1 Like

Thanks so much Nikita! That works perfectly.