1. 学ぶ
  2. /
  3. コース
  4. /
  5. Writing Functions and Stored Procedures in SQL Server

Connected

演習

Multi statement TVF

Create a multi statement table value function that returns the trip count and average ride duration for each day for the month & year parameter values passed.

指示

100 XP
  • Create a function CountTripAvgDuration() that returns a table variable named @DailyTripStats.
  • Declare input parameters @Month and @Year.
  • Insert the query results into the @DailyTripStats table variable.
  • Use CAST to select and group by StartDate as a date data type.