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

Home -> Community -> Usenet -> c.d.o.server -> Re: PLSQL Collection Question

Re: PLSQL Collection Question

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Wed, 20 Jun 2007 21:08:56 +0800
Message-ID: <467926E8.6F18@yahoo.com>


amerar_at_iwc.net wrote:
>
> Hi,
>
> I have 2 collections that are basically an array of numbers.
>
> I'm looking for some slick code that will compare collection #1
> against collection #2 and tell me how many elements of #1 are in #2.
>
> I can write some stupid FOR LOOP for WHILE LOOP with indexes and all,
> but I was wondering if anyone has something more slick or efficient?
>
> Thanks!

select ... from table(collection1)
minus
select ... from table(collection2)

or thereabouts...

-- 
Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions"
Co-author: "Oracle Insight - Tales of the OakTable"

web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald_at_yahoo.com


"Semper in excremento, sole profundum qui variat."

------------------------------------------------------------
Received on Wed Jun 20 2007 - 08:08:56 CDT

Original text of this message

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