niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
analytic function
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
sim
*nix forums beginner


Joined: 19 Aug 2005
Posts: 39

PostPosted: Thu Jul 20, 2006 11:36 am    Post subject: Re: analytic function Reply with quote

Billou schrieb:

Quote:
Hi,

using a select like:

select max(date) over (partition by...)

how can I retrieve a value from the same row than the max(date) ?
For example, how can I find the price value for the max(date) over that
partition ?

thank you

You could select not only the max(date) but also the key of the record
with max(date) using a group by and then join it with the table.
Something like this:

select a.price
from
your_table a,
(
select key
max(date)
from your_table
) b
where a.key = b.key

Regards,

Jörg
Back to top
Billou
*nix forums beginner


Joined: 23 Jun 2006
Posts: 1

PostPosted: Fri Jun 23, 2006 6:08 am    Post subject: analytic function Reply with quote

Hi,

using a select like:

select max(date) over (partition by...)

how can I retrieve a value from the same row than the max(date) ?
For example, how can I find the price value for the max(date) over that
partition ?

thank you
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 7:00 am | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Function Pointer Sikandar C 3 Fri Jul 21, 2006 1:23 pm
No new posts Arbitrary function with parameter darknails@gmail.com C++ 2 Fri Jul 21, 2006 9:58 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com apps 4 Fri Jul 21, 2006 3:22 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com C++ 1 Fri Jul 21, 2006 2:44 am
No new posts can I call a internal function directly? minrobin@gmail.com shell 2 Fri Jul 21, 2006 2:17 am

Loans | Personal Loans | Samsung | MPAA | Mortgage Calculator
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1986s ][ Queries: 20 (0.0994s) ][ GZIP on - Debug on ]