Question of the Day
What does this code return?
SELECT
( SELECT COUNT (*), MAX(soh.OrderDate) AS latestorder
FROM Sales.SalesOrderHeader AS soh
WHERE
soh.OrderDate > '01/01/2011'
AND soh.OrderDate < '01/01/2012') AS OrdersIn2000
, ( SELECT COUNT (*), MAX(soh.OrderDate) AS latestorder
FROM Sales.SalesOrderHeader AS soh
WHERE
soh.OrderDate > '01/01/2012'
AND soh.OrderDate < '01/01/2013') AS OrdersIn2001
, ( SELECT COUNT (*), MAX(soh.OrderDate) AS latestorder
FROM Sales.SalesOrderHeader AS soh
WHERE
soh.OrderDate > '01/01/2013'
AND soh.OrderDate < '01/01/2014') AS OrdersIn2002;
GO
See possible answers