I have a table with a column of integers called 'status'. A number may
appear 0+ times in this column. For example,
I know I can get counts of the each status using select count(status),
status from test_table group by status;
Let's say I have some lists of numbers, like so:
25 appears in the status column 3 times.
3 appears in the status column 6 times.
17 appears in the status column 2 times.
40 appears in the status column 0 times.
6 appears in the status column 1 time.
28 appears in the status column 2 times
Is it possible to get the following based on the above list of numbers:
the first column is the list of status, the second column is the sum of
the counts of the status codes appearing on the left of the "|"
Does anyone have any ideas on how to get this output without executing 4
pgsql-novice by date
|Next:||From: Andreas Junius||Date: 2008-12-01 17:27:18|
|Subject: SQL Status:42883|
|Previous:||From: Bruce Hyatt||Date: 2008-12-01 03:27:33|
|Subject: Re: Postgresql Books|