VERY URGENT PLEASE HELP [message #37772] |
Wed, 27 February 2002 09:42 |
Nina
Messages: 113 Registered: March 2000
|
Senior Member |
|
|
Does anyone know how one can perform a count on the returned by decode statement values?
I have the following example of decode:
DECODE(my_value, 'F', 'First Value', 'S', 'Second Value', 'T', 'Third Value').
In the end of the select I need to have the count of ALL these values. So it would look something like:
First Value - 9
Second Value - 8
Third Value - 0
Any ideas whould be great!
Thank you in advance.
First Value -
|
|
|
Re: VERY URGENT PLEASE HELP [message #37774 is a reply to message #37772] |
Wed, 27 February 2002 12:15 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
Do you mean something like:
select decode(my_value, 'F', 'First Value', 'S', 'Second Value', 'T', 'Third Value') value, count(*) count
from t
group by my_value;
VALUE COUNT
------------ ---------
First Value 8
Second Value 2
Third Value 5
|
|
|
|