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
РЕЗУЛЬТАТ:

ВОПРОС:
Как мне создать представление / запрос, в результате чего по одной строке для каждой основной записи (#foot) вместе с полями из последней вставленной детали (#note), если таковые имеются?
ЗАДАЧА:

(ПРИМЕЧАНИЕ: я бы сказал, какой из них самый последний, это идентификатор, который был бы выше для более новых записей)