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

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]
This may works. SELECT PERSON.PERSON_ID, COUNT(PERSON.SOC_SEC_NO) FROM PERSON HAVING COUNT(PERSON.SOC_SEC_NO) > 1; From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: quinta-feira, 4 de fevereiro de 2016 17:10 To: firebird-support@yahoogroups.com Subject:

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