title: Oracle SQL Developer: Sum rows based on value from another column
body: <pre><code>Trans. ID        QTY      TOOL   Date
      1            20        A2    2015
      2            20        A2    2016
      3            20        A2    2016
      4            20        A3    2015
      5            20        A3    2016
      6            20        A3    2016
      7            20        C     2016
      8            20        C     2016
      9            20        C     2016
      10           20        C     2016
  </code></pre>
  
  <p>To Return
  --Interested in 2016 only </p>
  
  <pre><code>Tool     Total
  A2         40
  A3         40
  </code></pre>
  
  <p>Im not interested in the individual IDS. Just more interested totals. 
  Please notw Im also interested in grabbing data with tools specifically starting with the letter A since the actual table has a bunch of tools. </p>
  
  <p>Im having a hard time figuring out how to put the WHERE statement and other things. I read in another thread to use distincts as well. </p>
  
  <pre><code>select Tool, sum(QTY)
  from 
    (select distinct Tool, ID, QTY from "table")
  where Tool like 'A%'
  AND Date like '2016%'
  group by PROCESS_EQP_ID
  </code></pre>