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
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:
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
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
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
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,