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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple Cursor

Re: Simple Cursor

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 26 Apr 2007 16:06:47 -0700
Message-ID: <1177628805.930780@bubbleator.drizzle.com>


Jimbo wrote:
> ok heres what Im trying to do....Im trying to flatten a record
> set...so say case number 07 has orders 1 and 3 associated with
> it....if you do a select youll get.
>
> case number order number
> ----------------- --------------------
> 07 1
> 07 3
>
> I want to use a cursor so I can concatenate the order number field and
> return
>
> case number order numbers order count
> ------------------ --------------------- -----------------
> 07 1, 3 2
>
> I can only think to do this with a cursor....if you know another way
> Im all ears
>
> -Jim

Have you heard of cross-tabulation? Pivot tables? Use DECODE.

Example at www.psoug.org
Click on Morgan's Library
Click on DECODE.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Apr 26 2007 - 18:06:47 CDT

Original text of this message

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