Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Uniqueness of columns

Uniqueness of columns

From: <analyst_user_at_my-deja.com>
Date: Thu, 10 Jun 1999 17:55:31 GMT
Message-ID: <7jou6d$oi4$1@nnrp1.deja.com>


I wanted to see if a column was unique so I have the following SQL:

select deptno, count(deptno) from dept a where deptno in (select deptno from dept b where a.rowid<>b.rowid)
group by deptno;

However I found out that there is uniqueness in the combination of columns. How can I rewrite this query to show the columns and count of the combined columns.

The columns are deptno, loc_cd, co_cd.

Any help would be greatly appreciated.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jun 10 1999 - 12:55:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US