[firebird-support] How do I count the number of duplicate rows in a table?

2014-10-28 Thread 'Softtech Support' stwiz...@att.net [firebird-support]
Greetings All, Firebird 1.5.3 Should be elementary but, I'm drawing a blank on how to accomplish this. I have a table (ACCT_CASE_COURT) that contains these fields (among others): ACCT_CASE_COURT_IDINTEGERNOT NULLPK ACCT_IDINTEGERNOT NULL CASE_IDSMALLINTNOT NULL

Re: [firebird-support] How do I count the number of duplicate rows in a table?

2014-10-28 Thread 'Martijn Tonies (Upscene Productions)' m.ton...@upscene.com [firebird-support]
select count(case_number) as counted, case_number from ACCT_CASE_COURT group by case_number ? With regards, Martijn Tonies Upscene Productions http://www.upscene.com Download Database Workbench for Oracle, MS SQL Server, Sybase SQL Anywhere, MySQL, InterBase, NexusDB and Firebird! From:

Re: [firebird-support] How do I count the number of duplicate rows in a table?

2014-10-28 Thread Tim Ward t...@telensa.com [firebird-support]
SELECT CASE_NUMBER, COUNT(*) FROM ACCT_CASE_COURT GROUP BY CASE_NUMBER That what you want? (The sorting comes for free.) On 28/10/2014 12:13, 'Softtech Support' stwiz...@att.net [firebird-support] wrote:  Greetings All, Firebird 1.5.3 Should be elementary but, I'm drawing a blank on how to

Re: [firebird-support] How do I count the number of duplicate rows in a table?

2014-10-28 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
Greetings All, Firebird 1.5.3 Should be elementary but, I'm drawing a blank on how to accomplish this. I have a table (ACCT_CASE_COURT) that contains these fields (among others): ACCT_CASE_COURT_IDINTEGERNOT NULLPK ACCT_IDINTEGERNOT NULL CASE_IDSMALLINTNOT NULL

Re: [firebird-support] How do I count the number of duplicate rows in a table?

2014-10-28 Thread 'Softtech Support' stwiz...@att.net [firebird-support]
Hi Martijn, I did finally come up with this SELECT DISTINCT(ACC.CASE_NUMBER), (SELECT COUNT(ACC2.ACCT_CASE_COURT_ID) FROM ACCT_CASE_COURT ACC2 WHERE ACC2.CASE_NUMBER = ACC.CASE_NUMBER) AS CNT FROM ACCT_CASE_COURT ACC GROUP BY 1 Nut, I like yours better. Now I need to exclude any

Re: [firebird-support] How do I count the number of duplicate rows in a table?

2014-10-28 Thread 'Martijn Tonies (Upscene Productions)' m.ton...@upscene.com [firebird-support]
Hello Mike, select count(CASE_NUMBER), CASE_NUMBER from ACCT_CASE_COURT group by CASE_NUMBER having count(CASE_NUMBER) 1 With regards, Martijn Tonies Upscene Productions http://www.upscene.com Download Database Workbench for Oracle, MS SQL Server, Sybase SQL Anywhere, MySQL, InterBase,