Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: GROUP BY
Assume the field is named long_field then
do a
select substr(long_field,1,6) mygrp,count(something)
from table
group by substr(long_field,1,6);
( If field is a number, then do a substr(to_char(long_field),1,6) instead..)
"inger ruud" <iru_at_provida.no> wrote:
>Hi!
>
>I would like to group my query by part of a field.
>
>Ex.
>
>25000000497670000000000
>27600000450947000000000
>57800000491818000000002
>57800000492500000000000
>
>I want to group by the 6 first characters.
>
>
>
>HELP!
>
Received on Mon May 21 2001 - 09:01:44 CDT