- Я хочу разные цифры, такие как Кредит, Финансирование, Приложение, Закрытие Даты для loan_officer.
- У меня есть таблица [E]. [Dbo]. [Main], к которой я применяю различные фильтры, а затем пытаюсь присоединиться к ним.Эта главная таблица имеет GUID в качестве первичного ключа.
Пожалуйста, предложите, как мне присоединиться к этим столам.
Select A.loan_officer, A.OrganizationId, [C].Credit as Credit,
[P].Application as 'App', [F].Funding as Fund, [B].ClosingDate as Brok
from
--Credit Pulls
(SELECT Credit
FROM [E].[dbo].[Main]
where Loan_Officer is not null
and LOANFOLDER IN ('Pipeline', 'Prospect', 'Employee Pipeline')) as [C],
--Application Units
(SELECT Application
FROM [E].[dbo].[Main]
where loan_Officer is not null
and LOANFOLDER IN ('Pipeline', 'Prospect', 'Employee Pipeline')
and Denial_Date is null ) as [P],
--Funding Units
(SELECT Funding
FROM [E].[dbo].[Main]
where loan_Officer is not null
and LOANFOLDER IN ('Pipeline', 'Prospect', 'Employee Pipeline')
and Denial_Date is null) as [F],
-- Brokered Units
(SELECT ClosingDate
FROM [E].[dbo].[Main]
where loan_Officer is not null
and LOANFOLDER IN ('Pipeline', 'Prospect', 'Employee Pipeline')
and Loan_Info_Channel_F2626 like 'Brok%'
) as [B],
[E].[dbo].[Main] A
Join [B] on B.ClosingDate_748 =A.ClosingDate_748
Join F on F.Funding_Date= A.Funding_Date
Join P on A.Application_Date= A.Application_Date
Join C on C.Credit_Pull_Date = A.Credit_pull_date