How can I retrieve the oldest record from a joined table in SQL with distinct values for a specific column and a certain condition?
I want to get distinct vale for column "ID" with condition "Status"=1 and pick the oldest "Date". There are 2 tables:Table1 | ID | Code | Date | |——— | ———|———-| |A123 |1234 |10/9/2018 | |A123 |7890 |9/8/2022 | |B666 |9088 |1/2/2021 | |C7633 |1048 |2/5/2019 | |A123 |5477 |8/3/2022 | Table2 | Code |… Read More How can I retrieve the oldest record from a joined table in SQL with distinct values for a specific column and a certain condition?