| List: | General Discussion | « Previous MessageNext Message » | |
| From: | jkraai | Date: | May 1 1999 2:11am |
| Subject: | Re: DISTINCT and COUNT() SQL Query | ||
| View as plain text | |||
Drop the distinct: SELECT lastname, count(*) FROM names GROUP BY lastname will give you all distinct last names and their counts --jim Mike Machado wrote: > > I am trying to find a query that would select the distinct names in a > field and return the number. I know select distinct lastname from names > will return the distinct list and have the total at the bottom, but > I would like to use the COUNT() as part of this. Something like select > distinct lastname, count(*) as c from names group by s, but this is not > working. Can anyone come up with a statement to do this? Thanks. > > -- > Mike Machado > mike@stripped > InnerCite > Network Specialist
| Thread | ||
|---|---|---|
| • DISTINCT and COUNT() SQL Query | Mike Machado | 1 May |
| • Re: DISTINCT and COUNT() SQL Query | jkraai | 1 May |
| • Re: DISTINCT and COUNT() SQL Query | Paul DuBois | 1 May |
| • RE: DISTINCT and COUNT() SQL Query | Don Read | 1 May |
| • Re: DISTINCT and COUNT() SQL Query | Mike Machado | 1 May |
| • Re: DISTINCT and COUNT() SQL Query | Thimble Smith | 1 May |
| • Re: DISTINCT and COUNT() SQL Query | Jim Faucette | 1 May |
| • 3.22.21 RAM Usage | jkraai | 2 May |
| • 3.22.21 RAM Usage | Michael Widenius | 2 May |
| • Re: 3.22.21 RAM Usage | jkraai | 2 May |
| • a problem | glen | 19 May |
| • Re: a problem (The table 'SQL134597_0' is full) | Pete Harlan | 20 May |
| • Re: a problem (The table 'SQL134597_0' is full) | glen | 20 May |
| • Re: a problem (The table 'SQL134597_0' is full) | Benjamin Pflugmann | 21 May |
| • Re: a problem (The table 'SQL134597_0' is full) | Michael Widenius | 24 May |
