- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- duplicate record sql
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 11:08 PM
тАО01-07-2004 11:08 PM
duplicate record sql
We have a 9i DB & would like to search for duplicate records on a specific column. Does anypne know
what the sql statement should look like?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 11:29 PM
тАО01-07-2004 11:29 PM
Re: duplicate record sql
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 11:42 PM
тАО01-07-2004 11:42 PM
Re: duplicate record sql
create view cnt_view as select
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 11:51 PM
тАО01-07-2004 11:51 PM
Re: duplicate record sql
select
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 11:54 PM
тАО01-07-2004 11:54 PM
Re: duplicate record sql
try this:
select col from table group by col having count(*) > 1;
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-08-2004 07:55 AM
тАО01-08-2004 07:55 AM
Re: duplicate record sql
delete from tableA
where rowid in
(select rowid from tableA minus
select max(rowid) from table group by columnA)
You will need to change tableA and columnA.
Thanks,
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-08-2004 03:54 PM
тАО01-08-2004 03:54 PM
Re: duplicate record sql
Also, consider the following example:
yd@MYDB.MU> create table t1 ( c1 int, c2 int, c3 char(1) );
Table created.
yd@MYDB.MU> insert into t1 values ( 1, 50, 'a' );
1 row created.
yd@MYDB.MU> insert into t1 values ( 1, 50, 'b' );
1 row created.
yd@MYDB.MU> insert into t1 values ( 2, 89, 'x' );
1 row created.
yd@MYDB.MU> insert into t1 values ( 2, 89, 'y' );
1 row created.
yd@MYDB.MU> insert into t1 values ( 2, 89, 'z' );
1 row created.
yd@MYDB.MU> delete from T1
2 where rowid <> ( select max(rowid)
3 from t1 b
4 where b.c1 = t1.c1
5 and b.c2 = t1.c2 )
6 /
3 rows deleted.
yd@MYDB.MU> select * from t1;
C1 C2 C
---------- ---------- -
1 50 b
2 89 z
I use it to delete duplicates.
hope this helps too!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-08-2004 03:55 PM
тАО01-08-2004 03:55 PM
Re: duplicate record sql
Did the following work:
select
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2004 07:03 AM
тАО01-09-2004 07:03 AM
Re: duplicate record sql
since you gave only 5 or 6 points to the group & having statements (which are correct as I think), could it be, that you ar not looking for these Values, but the entire records ?
Like this ?
select * from table where specific_column
in
(
select specific_column
from table
group by specific_column
having count(*) > 1 )
order by specific_column;
Do not know if this helps
Volker