orSELECT CustomerLastName,CustomerFirstName,[Checking] as [CheckingBalance],[Savings] as [SavingsBalance]FROM (SELECT Customers.CustomerLastName, Customers.CustomerFirstName, Accounts.AccountType, Accounts.AccountBalanceFROM Accounts INNER JOIN Customers ON Accounts.CustomerID = Customers.CustomerID)tPIVOT (SUM(AccountBalance) FOR AccountType IN ([Checking],[Savings]))p
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/