title: How do I add rows in one table in specific conditions?
body: <p>I work on an Oracle database.
  I have a table (it is a join table) but this is how it looks:</p>
  
  <pre><code>CustomerID           days_attached  Startdate   enddate              team  
  1                     7             01-01-2016   08-01-2016           A
  1                     2             09-01-2016   10-01-2016           B
  1                     8             01-02-2016   09-02-2016           A 
  2                     1             01-02-2017   02-02-2016           C
  2                     8             08-05-2017   16-05-2017           C 
  </code></pre>
  
  <p>I need to know how long a person is attached to a specific team. A person can be attached to a person for a X amount of days. That person could be in a team.  For instance in this case, how long is a person attached to team A = 7+8 15 days. </p>
  
  <p>How do I get this in a SQL statement? 
  Our app only supports SQL not PL/sql .</p>
  
  <p>I expect an output like:</p>
  
  <pre><code>CustomerID           days_attached           team  
  1                     15                       A
  1                     2                        B
  2                     9                        C
  </code></pre>