Thread View: borland.public.interbase.sql
3 messages
3 total messages
Started by Andy Murphy
Fri, 22 Nov 2002 11:19
Multiple counts
Author: Andy Murphy
Date: Fri, 22 Nov 2002 11:19
Date: Fri, 22 Nov 2002 11:19
10 lines
1211 bytes
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
Author: Arno Brinkman
Date: Fri, 22 Nov 2002 12:44
Date: Fri, 22 Nov 2002 12:44
21 lines
1388 bytes
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
Author: Andy Murphy
Date: Mon, 25 Nov 2002 12:47
Date: Mon, 25 Nov 2002 12:47
3 lines
1048 bytes
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