I am looking to create a function that given a custID, returns a table of all the different shipping times they have used and how many times they have used each shipping time.
I have the following tables
Customer (custID)
Order (custID, shipID)
Shipping (shipID, time)
The only code I have is the outline:
Create Function ShippingOptions(@int AS int)
Returns @table table (columnName nvarchar(20))
As
Begin
return
End