Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: table with sparce data
"Mikito Harakiri" <mikharakiri_at_ywho.com> wrote:
>
>"Mikito Harakiri" <mikharakiri_at_ywho.com> wrote in message
>news:Nxt1b.19$3j7.147_at_news.oracle.com...
>> Min Value Frequency
>> Name
>> ---- ------ -----------
>> a001 0 4
>> a005 5 1
>> a006 0 3
>> a011 3 1
>
>Missed one more typo:
>
>Min Value Frequency
>Name
>---- ------ -----------
>a001 0 4
>a005 2 1
>a006 0 3
>a011 3 1
>
>In other words we keep all rows with value > 0, and compress all the
>successive rows with value = 0 showing aggregated frequency.
>
>
Still not sure what you want, but try:
select name,value,count(*) from table
group by name,value;
Received on Fri Aug 22 2003 - 14:26:20 CDT