Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate data 1

Status
Not open for further replies.

jackie1948

Programmer
Jan 25, 2002
78
US
i have a table that has duplicate data. my question is can i run a query that will eliminate the duplicate data? then how do i do it as i have only limited experience with queries. THANKS
 
HI

USE myTable IN 0 ALIAS myTable

SELECT * FROM myTable ;
INTO DBF temp GROUP BY myKeyField

SELECT myTABLE
ZAP
APPEND FROM temp

Note the above pick up one record per key field. You have no idea as to which of the duplicate it picks up.. However as a sytax I have provided the SQL select above.

:)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I need to append my problem. My table is indexed on ssn. my duplicates are the check_dates under each ssn. i need to find all the check_date duplicates per each ssn.
 
Hi Jakie,

The follwoing will pull out all records for which duplicates exist in myTable, based on fields ssn+check_date.

SELECT ssn, check_date, * FROM myTable ;
WHERE ssn+DTOS(check_date) IN ;
(SELECT SSN+DTOS(check_date) FROM myTable ;
GROUP BY SSN+DTOS(check_date) ;
HAVING count(*) > 1)

if your ssn field is different name, suitably replace it.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top