LISTING 2: Solution 1, First Step: View That Returns Each Month’s Trend USE tempdb GO CREATE VIEW VTrends AS SELECT smonth, SIGN(qty- (SELECT qty FROM Sales WHERE smonth = (SELECT MAX(smonth) FROM Sales AS S2 WHERE S2.smonth < S1.smonth))) AS trend FROM Sales AS S1 GO