help with writing a complex SQL statement

From: <shanthi.viswanathan_at_gmail.com>
Date: 17 Nov 2005 13:37:03 -0800
Message-ID: <1132263423.043471.253260_at_g14g2000cwa.googlegroups.com>



[Quoted] 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 Received on Thu Nov 17 2005 - 22:37:03 CET

Original text of this message