Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Analytic Function (Oracle 10g)
Oracle Analytic Function [message #411075] Wed, 01 July 2009 15:51 Go to next message
Shankar Swamy
Messages: 2
Registered: October 2000
Junior Member
Wanted to make sure to pick the correct analytic function.
For a table with Person id , there can be multiple rows
Those rows will fall under the category of one Log id , and one Log id can have multiple Log sequence
For e-g
Person id Log id Log seq Log desc
1234 1 0 YYYY
1234 1 1 YYYY
1234 1 2 error
1234 2 0 XXXX
1234 2 1 .....etc

If I need to find out the max seq for each Log id , and reject all Log id with max seq = 'error' , then will the LAST_VALUE or LAST_FUNCTION will work.

Thx,
SS
Re: Oracle Analytic Function [message #411078 is a reply to message #411075] Wed, 01 July 2009 18:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.

Post DDL for tables.
Post DML for test data.

Post expected/desired results.
Re: Oracle Analytic Function [message #411100 is a reply to message #411075] Wed, 01 July 2009 23:10 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Why do you think you need an analytic function?
What is LAST_FUNCTION?

Post a working Test case: create table and insert statements along with the result you want with these data.

Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Re: Oracle Analytic Function [message #411175 is a reply to message #411075] Thu, 02 July 2009 04:36 Go to previous message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
According to your specification, MAX() as aggregate is suffice.

regards,
Delna
Previous Topic: where clause for previous month date
Next Topic: using cursor returned from another stored proc
Goto Forum:
  


Current Time: Tue Feb 11 16:58:57 CST 2025