devxlogo

Counting Specific Records

Counting Specific Records

Question:
How do I count the records for a specific field? For example, I’m building a table for homes in a county. In the table are fields for cities and addresses for homes. I want to be able to get the results of how many homes are located in city1, how many homes are in city2, etc.

I’ve read things on Count and Move. Am I headed in the right direction?

Answer:
I’m not certain this will help you, but I think you are after COUNT DISTINCT CITY, which will give you the distinct number of entries in the city column.

Say you’re in California and your table has 1,000 records in it. You have 650 Los Angeles records, 250 San Francisco records, and 100 Santa Barbara records. COUNT DISTINCT CITY would then be three.

See also  Using Consumer Trust to Help Build Brands On Major Social Platforms
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist