Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Help Need
Are
all the columns in user repeated? I doubt it because you would just remove
duplicate records. I am assuming userid is key field.
You
could try
<FONT face=Arial color=#0000ff
size=2>
CREATE
TABLE usercheck AS SELECT * FROM user;
ALTER
TABLE usercheck ADD(repeated NUMBER);
UPDATE
usercheck a
SET
repeated = (SELECT COUNT(*) - 1
<FONT face=Arial color=#0000ff
size=2>
size=2>
size=2>
size=2>
From: Deewaker G.V.
[mailto:Deewaker_at_baazee.com]Sent: Thursday, August 02, 2001 7:40
AMTo: Multiple recipients of list ORACLE-LSubject: Help
Need
Hi DBA Gurus,
I have a table called user..
It has userid, firstname, lastname,
city, address, telephone, email
There are some userid which have
been reentered .. I would like to insert a column called repeats and take the
number of times the userid is repeated
How to I go about it
Create table usercheck as (userid,
firstname, repeated,lastname, city, address, telephone, email)
As <FONT
face="Arial Narrow" color=#0000ff>Select userid, firstname, count(*) userid as
repeated,,lastname, city, address, telephone, email) <FONT
face="Arial Narrow" color=#0000ff>From user;
Something like this..
For example the userid of Deewaker
is 123123 and he as been inserted 5 times in the table USER the Repeated
should give a count of 4.
Please help me.
with warm regards,
Deewaker G. V.
Baazee.com India Pvt. Ltd.
(<FONT face="Book Antiqua"
color=#0000ff>: 4611323 Extn: 216 <FONT face="Book Antiqua"
color=#0000ff>Fax : 4611324
<<Deewaker G.V..vcf>>
Received on Fri Aug 03 2001 - 00:52:44 CDT
![]() |
![]() |