OK, let me guess at what you're after:<br>
<br>
I think what you are trying to do is count how many occurrences of certain values occur in a column. For instance, if the data in your column looks like:<br>
<br>
X<br>
---------<br>
3<br>
5<br>
5<br>
5<br>
3<br>
<br>
then you would like your output to look like:<br>
<br>
count_of_3 .............count_of_5<br>
..............2... ...................... 3<br>
(Ignore the periods - I just have to put something in to maintain the space between columns.)<br>
<br>
This can be done with the following query:<br>
<br>
SQL> SELECT(DECODE(x,3,1,NULL)) count_of_3, COUNT(DECODE(x,5,1,NULL)) count_of_5<br>
2 FROM your_table;<br>
<br>
Hopefully you aren't testing for too many values.<br>
<br>
To make this dynamic (so that you don't need to know the range of values ahead of time), you would probably be better off creating a procedure so you can pull the values into a cursor and explicitly count them.<br>
<br>
Let us know if this answers the question.