Re: Quick SQL question . . .

Поиск
Список
Период
Сортировка
От Marie G. Tuite
Тема Re: Quick SQL question . . .
Дата
Msg-id IGELKLINGDMODABPOOFECEBNCCAA.marie.tuite@edisonaffiliates.com
обсуждение исходный текст
Ответ на Quick SQL question . . .  ("Peter E. Chen" <pchen3@jhmi.edu>)
Ответы Re: Quick SQL question . . .  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Список pgsql-general
Try

select identno, count(identno) from some_table group by identno having
count(identno) >=1;


-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Peter E. Chen
Sent: Thursday, May 09, 2002 2:39 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Quick SQL question . . .


Can anyone tell me what is the easiest way for me to tell if a column is
unique or not?  I tried using DISTINCT ON and COUNT together in a SELECT
statement, but I can't seem to get the query to work:

SELECT DISTINCT ON (identno) count(identno) FROM some_table;

I was trying to figure out if the # of unique entries for a particular
column is equal to the # of total entries for that column.

Any suggestions?

Peter




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


В списке pgsql-general по дате отправления:

Предыдущее
От: Fran Fabrizio
Дата:
Сообщение: Re: Quick SQL question . . .
Следующее
От: Herbert Liechti
Дата:
Сообщение: Re: Quick SQL question . . .