Hi,
I have a left outer join query that links two tables:
Table 1.
field_a char(10) <- primary key
field_b char(20)
Table 2.
field_c char(10) <- links to field_a in table 1
field_d datetime
There may be several records in table 2 for every record in table 1. field_c is not unique in table 2.
I want to join a left outer join from table 1 to table 2, but I only want to return the most recent value in table 2, i.e. the most recent datetime in field_d.
Any ideas on how to do this in a SQL query?
I have a left outer join query that links two tables:
Table 1.
field_a char(10) <- primary key
field_b char(20)
Table 2.
field_c char(10) <- links to field_a in table 1
field_d datetime
There may be several records in table 2 for every record in table 1. field_c is not unique in table 2.
I want to join a left outer join from table 1 to table 2, but I only want to return the most recent value in table 2, i.e. the most recent datetime in field_d.
Any ideas on how to do this in a SQL query?