title: Multiple SUM values using WHERE clauses in Oracle
body: <p>I am writing a SQL statement against an Oracle 10g database. I want to obtain the SUM of a field with three different conditions. Can I do this with one query?</p>
  
  <p>This is pseudo-SQL for what I want:</p>
  
  <pre><code>SELECT SUM(CP) AS CPTotal,
  (SUM(CP) FROM tasks WHERE Code='P') AS CPProd,
  (SUM(CP) FROM tasks WHERE Code='S') AS CPSupp
  FROM tasks;
  </code></pre>