Re: [SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Tom Lane wrote: > > Joseph Shraibman <[EMAIL PROTECTED]> writes: > Using the example from > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > do if I wanted to know the number of different cities where I had a > friend in each state? select count(city)

Re: [SQL] counting distinct values

2000-06-07 Thread Tom Lane
Joseph Shraibman <[EMAIL PROTECTED]> writes: Using the example from http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I do if I wanted to know the number of different cities where I had a friend in each state? select count(city) group by state; would not wor

Re: [SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Bruce Momjian wrote: > > > Using the example from > > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > > do if I wanted to know the number of different cities where I had a > > friend in each state? select count(city) group by state; would not work > > because if you had

Re: [SQL] counting distinct values

2000-06-07 Thread Bruce Momjian
> Using the example from > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > do if I wanted to know the number of different cities where I had a > friend in each state? select count(city) group by state; would not work > because if you had two friends in the same city it wo