sql - Eliminating duplicates.. and more fun -


my goal query calculate original loan balance of each seperate loan identifier. however, data i'm using uses each loan identifier multiple times show current actual loan balance different months. therefore, when try calculate original loan balance, adds original loan balance every time loan identifier appears. want isolate 1 original loan balance per loan identifier having trouble doing so. original idea filter data using clause on unique characterisitc of loan. example, filtering data 1 monthly reporting period. however, monthly reporting period 'performance_2011q4" data , can not added clause when filtering 'original unpaid principal balance' fom 'total acquisition file'. have tried join 2 tables having trouble trying filter search. know how eliminate duplicates in list , calculate 1 'original unpaid principal balance' per loan identifier? thank , let me know if need me clarify. code posted below 'where' clause can't bound.

sql server 2012

 select a.[loan identifier]           ,[monthly reporting period]           ,[servicer name]           ,[current interest rate]           ,[current actual unpaid principal balance]             ,[loan age]           ,[remaining months legal maturity]           ,[adjusted remaining months maturity]           ,[maturity date]           ,b.[original unpaid principal balance (upb)]           ,[zero balance code]           ,[zero balance effective date]              dbo.performance_2011q4       join dbo.totalacquisition b on a.[loan identifier] = b. [loan identifier]         select (sum(convert (float, (dbo.[totalacquisition].[original unpaid principal balance (upb)])))) dbo.totalacquisition    dbo.performance_2011q4.[monthly reporting period] = '03/01/2013' 

you've not given go on in terms of sample data, i'm making assumptions data. assumption although have multiple records in totalacquisition, original unpaid principal balance same given loan identifier. if so, should work...

select distinct [loan identifier], [original unpaid principal balance (upb)] totalacquisition 

if isn't you're looking for, give more information sample rows each table 1 load id.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -