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.

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
Messages: 25578
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
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: 65150
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why do you think you need an analytic 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).

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

Previous Topic: Creating oracle table from external files
Next Topic: Partition error
Goto Forum:

Current Time: Mon Aug 21 16:51:27 CDT 2017

Total time taken to generate the page: 0.01961 seconds