Re: help with writing a complex SQL statement

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 17 Nov 2005 14:48:38 -0800
Message-ID: <1132267720.157248_at_yasure>


shanthi.viswanathan_at_gmail.com wrote:
> I need to write a single query and need help with this.
>
> I have a PL/SQL function that accepts an array called metadataarray as
> an in parameter and returns the latest seq number. This array is of
> record type metadatatype with 3 elments source_code, source_date, seq
>
> I have a priority_table that determines which source_code has higher
> priority. Examples of records in this table are:
> Telcom 1
> Reuters 2
> YellowPages 3 etc.
>
> The logic is as follows:
> Match the input parameter with the priority_table on source_code and
> sort the results by source_date, priority. Return the seq associated to
> the first record.
>
> Can I do this in a simgle SQL statement?
>
>
> Thanks

No. You will need PL/SQL.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Thu Nov 17 2005 - 23:48:38 CET

Original text of this message