title: SQL Query for a table
body: <p>I’m looking for a little assistance.  I have a table called equipment.  One row is an order of some type of equipment.</p>
  
  <p>Here are the fields:</p>
  
  <pre><code>num_id     date     player_id     order_id    active    jersey    comment
  BIGINT     DATE     BIGINT        BIGINT     CHAR(1)    CHAR(3)   VARCHAR(1024)
  11       2018-01-01  123            1           Y       XL  
  11       2018-01-01  123            2           Y       M       Purple
  11       2018-01-01  123            3           Y       L       White, Red
  13       2018-01-11  456            1           N       S       Yellow, Light Blue
  14       2018-02-01  789            1           Y       M       Orange, Black
  15       2018-02-02  101            1           Y       XL      Shield
  15       2018-02-02  101            2           Y       XL      Light Green, Grey
  </code></pre>
  
  <p>I need to write a query that shows one row for each month with the columns
  Month
  Total Orders
  Total Products ordered
  And one extra column for a total count of each size sold. </p>
  
  <p>Is this easy?  Any help would be appreciated.</p>
  
  <p>EDIT:  To answer people's questions below, SQL Server is the dbms. My apologies. As well, I am struggling as I don't know how to get the month from a date. And then adding the column for size counts has me baffled, but I haven't fully investigated that portion. I feel like the rest I have done individually, just never did it in one succinct query.</p>
  
  <p>It looks weird here and I don't know how to add a table to stackoverflow, so I'll try to make it a little more visually appealing here:</p>
  
  <p>The end goal I think would be like this:</p>
  
  <pre><code>Month   Total Orders    Total Products Ordered  Size Count
  January   1              3                      S-0, M-1, L-1, XL-2
  
  February  3              6                      S–1, M–2, L–1, XL–3
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>Month   Total Orders    Total Products Ordered  S Count M Count L Count XL Count
  January  1              3                         0       1       1       2
  February 3              6                         1       2       1       3
  </code></pre>