Re: [firebird-support] How do find duplicates in a table?

2016-02-05 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
If PERSON_ID is unique and you have an index on SOC_SEC_NO, you can find all records with duplicate SOC_SEC_NO this way (ordered by SOC_SEC_NO, so that they are kind of grouped together): SELECT * FROM PERSON P WHERE EXISTS(SELECT * FROM PERSON P2 WHERE P.PERSON_ID <> P2.PERSON_ID

RE: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread 'Edward Mendez' emendez...@nc.rr.com [firebird-support]
ope this is useful, Edward From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: Thursday, February 4, 2016 3:09 PM To: firebird-support@yahoogroups.com Subject: RE: [firebird-support] How do find duplicates in a table? Thanks Woody much simpler. F

Re: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
04.02.2016 20:09, 'stwizard' stwiz...@att.net [firebird-support] wrote: > How do I form a SQL Select statement that will return which records in my > PERSON table > have duplicate SOC_SEC_NO. RTFM GROUP BY, HAVING, COUNT(). -- WBR, SD.

RE: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread 'stwizard' stwiz...@att.net [firebird-support]
ort@yahoogroups.com Subject: Re: [firebird-support] How do find duplicates in a table? 04.02.2016 20:09, 'stwizard' stwiz...@att.net [firebird-support] wrote: > How do I form a SQL Select statement that will return which records in > my PERSON table have duplicate SOC_SEC_NO. RTFM GROUP B

[firebird-support] How do find duplicates in a table?

2016-02-04 Thread 'stwizard' stwiz...@att.net [firebird-support]
Greetings All, How do I form a SQL Select statement that will return which records in my PERSON table have duplicate SOC_SEC_NO. In other words I need a list of persons where the social security number appears in the database more than once. Some SOC_SEC_NO may be null which I do not

Re: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread 'Woody' woody-...@gt.rr.com [firebird-support]
ard' stwiz...@att.net [firebird-support] Sent: Thursday, February 04, 2016 1:37 PM To: firebird-support@yahoogroups.com Subject: RE: [firebird-support] How do find duplicates in a table? I had finally figured it out just before your reply SELECT DISTINCT P.SOC_SEC_NO, (SELECT CO

Re: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread Alexey Kovyazin a...@ib-aid.com [firebird-support]
age- From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: Thursday, February 04, 2016 1:25 PM To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] How do find duplicates in a table? 04.02.2016 20:09, 'stwizard' stwiz...@att.net [firebird-supp

RE: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread Peterson Seridonio loukinh...@hotmail.com [firebird-support]
ect: [firebird-support] How do find duplicates in a table? Greetings All, How do I form a SQL Select statement that will return which records in my PERSON table have duplicate SOC_SEC_NO. In other words I need a list of persons where the social security number appears in the datab

RE: [firebird-support] How do find duplicates in a table?

2016-02-04 Thread 'stwizard' stwiz...@att.net [firebird-support]
Thanks Woody much simpler. From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: Thursday, February 04, 2016 1:42 PM To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] How do find duplicates in a table? Try this instead: Select Soc_Sec_No