🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
3 messages
3 total messages Started by Andy Murphy Fri, 22 Nov 2002 11:19
Multiple counts
#11338
Author: Andy Murphy
Date: Fri, 22 Nov 2002 11:19
10 lines
1211 bytes
Does anyone know how i would count the number of records via a distinct
selection.

i.e. Select distinct Agent_Name from Table1 brings me all the agents but I
would like to do a record count for each without having to do a select
count(*) for each one manually?

Thanks,

Andy
Re: Multiple counts
#11339
Author: Arno Brinkman
Date: Fri, 22 Nov 2002 12:44
21 lines
1388 bytes
Hi,

> Does anyone know how i would count the number of records via a distinct
> selection.
>
> i.e. Select distinct Agent_Name from Table1 brings me all the agents but I
> would like to do a record count for each without having to do a select
> count(*) for each one manually?

If i understand you right then use GROUP BY.

SELECT
  AGENT_NAME,
  COUNT(*)
FROM
  Table1
GROUP BY
  AGENT_NAME

Regards,
Arno Brinkman
Re: Multiple counts
#11368
Author: Andy Murphy
Date: Mon, 25 Nov 2002 12:47
3 lines
1048 bytes
Thanks,

Andy.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads