Quick SQL question . . .

From: "Peter E(dot) Chen" <pchen3(at)jhmi(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Quick SQL question . . .
Date: 2002-05-09 19:39:18
Message-ID: JBEOIGCPFENBBBIKPPLCCEFLCEAA.pchen3@jhmi.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fran Fabrizio 2002-05-09 19:54:33 Re: Quick SQL question . . .
Previous Message Mike Diehl 2002-05-09 19:21:42 Re: having trouble w/ having clause...