Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Rows with duplicate values.
In article <8a4f8p$lql$1_at_starlifter.bentonrea.com>,
"rob nelson" <nelsons_at_bentonrea.com> wrote:
> We have a warehouse application that allows employee identity to be
> duplicated. I need to detect when this occurs. Is there a SQL syntax
for
>
> SELECT employeeid where rowcount(employeeid) > 1
>
> ?
>
>
Look at this:
SQL> create table test (mycol int);
Table created.
SQL> insert into test values (1);
1 row created.
SQL> insert into test values (2);
1 row created.
SQL> insert into test values (1);
1 row created.
SQL> select * from test;
MYCOL
1 2 1
SQL> select * from test group by mycol having count(*) > 1;
MYCOL
1
--
Yong Huang
(yong321_at_yahoo.com)
(http://www.stormloader.com/yonghuang/)
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Mar 07 2000 - 23:05:39 CST