??????????????????????????????????н?????????????????????????????????????????????ó???????????????????????????????????????κι?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ó?????????????????????????????????????????????????ó????????????????汾?????????μ??????????У??????????????????????????????????C#?? LINQ????????????????

???????????????????????NUnit???????????????????????????????C#??д???????????????????á?????? NUnit???????????http://www.nunit.org/index.php?p=download?????????????????????????????????????http://www.nunit.org/index.php?p=installation&r=2.5.2??????????????е??????????????????????????????????????????????????????Щ??????????????????????http://www.anydbtest.com?? AnyDBTest??????????????????????????????XML?????????????????????????????????????????????????????????????У?飬????Oracle??SQL Server??MySQL????

?????????????????????????????????????????????????????????????????????????磬?????PnL ????????а汾???????????????????????????????????PnL???????м????????????????????????????????μ?PnL??????ó???汾????????μ?PnL??????????????????????????е???μ?PnL??????ó??????????????????????????????????????????????μ???????????е???μ?PnL???schema??

????Use testDB

????GO

????CREATE TABLE OldPnLReport

????( AccountNumber int??

????NetSales decimal(9??2)??

????Costs decimal(9??2)??

????NetIncome decimal(9??2)??

????ReportDate smalldatetime

????)

????GO

????CREATE TABLE NewPnLReport

????( AccountNumber int??

????FurnitureSales decimal(9??2)??

????ServiceSales decimal(9??2)??

????Costs decimal(9??2)??

????NetIncome decimal(9??2)??

????ReportDate smalldatetime

????)

????GO

??????????NewPnLReport??FurnitureSales??ServiceSales???????NetSales??OldPnLReport??????????????Щ?????

????SELECT [AccountNumber]

??????[NetSales]

??????[Costs]

??????[NetIncome]

????FROM [testDB].[dbo].[OldPnLReport]

????WHERE ReportDate=??2009-10-16??

????GO

????SELECT [AccountNumber]

??????([FurnitureSales] + [ServiceSales]) as [NetSales]

??????[Costs]

??????[NetIncome]

????FROM [testDB].[dbo].[NewPnLReport]

????WHERE ReportDate=??2009-10-16??

????GO

?????????????????????