home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch06code / listings / 06list16.txt < prev    next >
Text File  |  1995-08-10  |  518b  |  12 lines

  1. Listing 6.16[em]The HAVING Clause Filters the Display of the Selected Group Records
  2. SELECT SL.SalesID, Min(SL.Quantity * RT.Retail) AS Minsls,  _
  3.      Max(SL.Quantity * RT.Retail) AS Maxsls,  _
  4.      Avg(SL.Quantity * RT.Retail) AS Avgsls,  _
  5.      Sum(SL.Quantity * RT.Retail) AS Totsls,  _
  6.      Sum(SL.Quantity) AS Totvol  _
  7.      FROM Sales AS SL, [Retail Items] AS RT  _
  8.      SL INNER JOIN RT ON SL.[Item Code]=RT.[Item Code]  _
  9.      GROUP BY SL.SalesID  _
  10.      HAVING Sum(SL.Quantity * RT.Retail) > 3000
  11.  
  12.