MySQL Forums
Forum List  »  French

Oracle LAG OVER en Mysql
Posted by: Stéphane Guyot
Date: March 27, 2014 04:32AM

Bonjour,

Je souhaite convertir / trouver un équivalent de la requête Oracle ci dessous utilisant la fonction LAG OVER dans Oracle en requête MySQL.

SELECT B.DAY AS CURRENT_DAY,
B.HLRID AS CURRENT_HLRID,
B.RANK AS CURRENT_RANK,
LAG(B.DAY,1) OVER (ORDER BY B.HLRID ASC,B.RANK ASC,B.DAY ASC) AS PREVIOUS_DAY,
LAG(B.HLRID,1) OVER (ORDER BY B.HLRID ASC,B.RANK ASC,B.DAY ASC) AS PREVIOUS_HLRID,
LAG(B.RANK,1) OVER (ORDER BY B.HLRID ASC,B.RANK ASC,B.DAY ASC) AS PREVIOUS_RANK
FROM OPM_DATA_DB.ALC_HLR_SUPSER_PEG_HH B

Comment puis-je faire cela ?

Merci pour votre aide.

Options: ReplyQuote


Subject
Views
Written By
Posted
Oracle LAG OVER en Mysql
3330
March 27, 2014 04:32AM
1926
March 28, 2014 12:40AM
1569
March 28, 2014 02:03AM


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.