QUERY:

```
drop table #foot
create table #foot (
    id int primary key not null,
    name varchar(50) not null
)
go

drop table #note
create table #note (
    id int primary key not null,
    note varchar(MAX) not null,
    foot_id int not null references #foot(id)
)
go

insert into #foot values 
(1, 'Joe'), (2, 'Mike'), (3, 'Rob')
go

insert into #note (id, note, foot_id) values (1, 'Joe note 1', 1)
go
insert into #note (id, note, foot_id) values(2, 'Joe note 2', 1)
go
insert into #note (id, note, foot_id) values(3, 'Mike note 1', 2)
go

select F.name, N.note, N.id
from #foot F left outer join #note N on N.foot_id=F.id

```

RESULT:

![enter image description here](https://i.stack.imgur.com/Luzvk.png)

QUESTION:

How can I create a view/query resulting in one row for each master record (#foot) along with fields from the most recently inserted detail (#note), if any?

GOAL:

![enter image description here](https://i.stack.imgur.com/ZmXGJ.png)

(NOTE: the way I would tell which one is most recent is the id which would be higher for newer records)