Hello.
I have 2 tables. In 1st one I have elements that have ID, ID2 and NAME columns. ID2 is a column needed for second table. In 2nd table I have ID, SOMENUMBERS, SOMENUMBERS2, DATE and ID2 columns.
In first table there are uniqe elements, In second I have hundreds of entries
I want to join those two tables on ID2 column. But there is a DATE column. Is there any way to join those tables that first is sorted by date from newest to oldest, then shown only first entry then joined by ID2 column?
I know i must use subquery. But how?
PS. I use postgre sql
I have 2 tables. In 1st one I have elements that have ID, ID2 and NAME columns. ID2 is a column needed for second table. In 2nd table I have ID, SOMENUMBERS, SOMENUMBERS2, DATE and ID2 columns.
In first table there are uniqe elements, In second I have hundreds of entries
I want to join those two tables on ID2 column. But there is a DATE column. Is there any way to join those tables that first is sorted by date from newest to oldest, then shown only first entry then joined by ID2 column?
I know i must use subquery. But how?
PS. I use postgre sql