Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi im trying to find out how to find max of transaction_date per EAN_code
- my table looks like
- Transaction_Date EAN_Code
- 09/04/2018 3029440000286
- 09/04/2018 3029440000286
- 08/04/2018 5000128221139
- 14/04/2018 5000128221139
- 08/04/2018 5000128221139
- 10/04/2018 5000128221108
- SELECT *
- FROM (SELECT *,ROW_NUMBER() OVER(PARTITION BY Ean_Code
- ORDER BY Transaction_Date DESC) AS rn
- FROM table_name) s
- WHERE s.rn = 1;
Add Comment
Please, Sign In to add comment