Cassio Posted April 2, 2003 Posted April 2, 2003 How can I count the total number of rows without repeating the equal rows of a certain column? SELECT COUNT( DISTINCT field) FROM table I guess it works on Interbase, but not on access. Any ideas? Thanks! Quote Stream of Consciousness (My blog)
philprice Posted April 2, 2003 Posted April 2, 2003 use GROUP BY at the end, peace. Quote Phil Price� Visual Studio .NET 2003 Enterprise Edition Microsoft Student Partner 2004 Microsoft Redmond, EMEA Intern 2004
Cassio Posted April 2, 2003 Author Posted April 2, 2003 But the group by won't return the table total number of rows. It will return the number of rows for each repeated value. Quote Stream of Consciousness (My blog)
Moderators Robby Posted April 2, 2003 Moderators Posted April 2, 2003 If all you want is a total count... "SELECT count(*) as totCount FROM Table" Quote Visit...Bassic Software
Cassio Posted April 2, 2003 Author Posted April 2, 2003 I want the total count without the repeated values, it would be like this: SELECT COUNT(SELECT DISTINCT Field1 FROM Table) FROM Table It would count how many distinct values are on a certain field. Quote Stream of Consciousness (My blog)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.