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 -> Re: Uniqueness of columns

Re: Uniqueness of columns

From: Gocha Mchedlishvili <gocham_at_cwix.com>
Date: Fri, 11 Jun 1999 02:18:55 GMT
Message-ID: <jm_73.5450$7_6.15520@news.cwix.com>


Following query should do it

select deptno, loc_cd, co_cd, count(1) from dept
group by deptno, loc_cd, co_cd

Gocha

analyst_user_at_my-deja.com wrote in message <7jou6d$oi4$1_at_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 - 21:18:55 CDT

Original text of this message

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