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