I’m trying to produce a query on the following table (relevant portion only):
Create Table [Order] (
OrderID int NOT NULL IDENTITY(1,1),
CreationDate datetime NOT NULL,
CustomerID int NOT NULL
)
I would like to see a list of CustomerIDs with each customer’s average number of days between orders. I’m curious if this can be done with a pure set based solution or if a cursor/temp table solution is necessary.
1 Answer