MySQL Forums
Forum List  »  Newbie

Help with a query please
Posted by: JC JC
Date: February 27, 2023 05:38AM

I have this table:

YEAR CODE PRICE1
2020 00001 25
2020 00001 10
2020 00002 30
2021 00001 40
2022 00010 50
I need that, when the year and code repeats, obtain one only row eith the PRICE1 column with the highest value of the repated records and a second "virtual" column called PROCE2 with the lowest value of the duplicated rows:

YEAR CODE PRICE1 PRICE2
2020 00001 25 10

Thanks,

Options: ReplyQuote


Subject
Written By
Posted
Help with a query please
February 27, 2023 05:38AM


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.