Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Uniqueness of columns
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