MySQL Forums
Forum List  »  Oracle

Re: Oracle Analytic Functions (aggregates)
Posted by: Dejan Topalovic
Date: January 11, 2007 02:07PM

delirii Wrote:
-------------------------------------------------------
> Is there any way to write a workaround for this
> type of query (FIRST_VALUE) ?
>
> How to select the fist value in a 2 rows ordered
> result set ?
>
> For instance in this ordered result set :
>
> A B
> 'aaa' 'a'
> 'bbb' 'a'
> 'ccc' 'b'
> 'ddd' 'a'
> 'eee' 'c'
> 'fff' 'b'
>
> only return the values :
>
> 'aaa' 'a'
> 'ccc' 'b'
> 'eee' 'c'
>
> And maintain this order...

Maybe:

SELECT MIN(a), b
...your statement...
GROUP BY b
ORDER BY b;

http://www.baze-podataka.net/
- Database Consultant & DBA -
Certified MySQL 5.0 DBA
Oracle 9i OCP DBA
Oracle 10g OCP DBA

Options: ReplyQuote


Subject
Views
Written By
Posted
10124
October 20, 2004 11:42AM
Re: Oracle Analytic Functions (aggregates)
6250
January 11, 2007 02:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.