摘要:
-- SQL create view with CTE (Common Table Expression)USE AdventureWorksGOCREATE VIEW vSalesStaffQuickStatsAS WITH SalesBySalesPerson (SalesPersonID, NumberOfOrders, MostRecentOrderDate) AS ( SELECT SalesPersonID, COUNT(*), MAX(OrderDate) FROM Sales.SalesOrderHeader ... 阅读全文