Я не могу понять оператор для перехода от SourceTable
к NewViewResult
.
В настоящее время источник все еще находится на Microsoft SQL Server 2012.
Описание источника и ожидаемый результат
Ниже приведен код для создания и заполнения SourceTable
:
CREATE TABLE SourceTable
(
[Contract] [nvarchar] (255) NULL,
[Role] [nvarchar] (255) NULL,
[Name] [nvarchar] (255) NULL
);
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('First Contract', 'Author', 'Tom');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('First Contract', 'Manager', 'Ben');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('First Contract', 'Reviewer', 'Kate');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('First Contract', 'Signee', 'John');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('First Contract', 'Singee 2', 'Eli');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Author', 'Chris');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Manager', 'Susan');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Davis');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Tomi');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Jane');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Dolly');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Ray');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Pat');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Reviewer', 'Amy');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Signee', 'Eli');
INSERT INTO [SourceTable] ([Contract], [Role], [Name])
VALUES ('Another Contract', 'Signee 2', 'John');