USE SQL2008SBS
GO

SELECT a.OrderID, CASE WHEN c.CompanyName IS NOT NULL THEN c.CompanyName ELSE c.FirstName + ' ' + C.LastName END CustomerName, 
a.OrderDate, a.SubTotal, a.TaxAmount, a.ShippingAmount, a.GrandTotal, a.FinalShipDate, b.OrderDetailID, b.SKU, b.Quantity, 
b.UnitPrice, b.Quantity + b.UnitPrice LineItemTotal
FROM Archive.OrderHeader a INNER JOIN Archive.OrderDetail b ON a.OrderID = b.OrderID
INNER JOIN Customers.Customer c ON a.CustomerID = c.CustomerID
GO
