| From: | Jie Liang <jliang(at)ipinc(dot)com> |
|---|---|
| To: | Mikael Hedin <mikael(dot)hedin(at)irf(dot)se> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: problem to count (distinct number) |
| Date: | 2001-01-18 20:59:25 |
| Message-ID: | Pine.BSF.4.10.10101181258040.82821-100000@tidal.ipinc.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
hi,there,
I don't see the problem except extra space, try:
SELECT COUNT(DISTINCT data) FROM media;
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
jliang(at)ipinc(dot)com
www.ipinc.com
On 17 Jan 2001, Mikael Hedin wrote:
> Hi,
>
> I have a table with a column (int4), and I want to know how many
> different numbers there are. In an example book I saw the query
>
> SELECT COUNT (DISTINCT data ) FROM media;
>
> by then I get
>
> ERROR: parser: parse error at or near "distinct"
>
> Is the query in error or does PostgreSQL not support this? How do I
> then get the number of distinct data from my table?
>
> TIA,
>
> Micce
>
>
> --
> Mikael Hedin, MSc +46 (0)980 79176
> Swedish Institute of Space Physics +46 (0)8 344979 (home)
> S-Box 812, 981 28 KIRUNA, Sweden +46 (0)70 5891533 (mobile)
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Stephan Szabo | 2001-01-18 21:01:16 | Re: problem to count (distinct number) |
| Previous Message | Kaare Rasmussen | 2001-01-18 20:46:04 | PostgreSQL HOWTO |