Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: GROUP BY

Re: GROUP BY

From: TurkBear <noone_at_nowhere.com>
Date: Mon, 21 May 2001 09:01:44 -0500
Message-ID: <kn7igtc1ob2knctc5lq5bahn2gv0jh7c27@4ax.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US