Summarize events using the MIN, MAX and COUNT functions
To do this, create variables to maintain each of the aggregates:
Variable What will eventually contain
@EarliestDate The earliest date
@LatestDate The last date
@NumberOfEvents The number of events
@EventInfo The Event Summary title
Now use a single SELECT clause to set the value of all these variables (alternatively, you could use a series of subqueries).
Write another SELECT clause to show the value of the variables, to show the summary output shown above.
I'm having trouble doing this exercise.
Is there any place where I can get the solution?
Thanks in advance!