title: How to find the parent and child relation in sql
body: <p>I have the data like below and trying to get the sum of time taken by parent.</p>
  <p>Input</p>
  <pre><code>ID_P    ID_C    SLA FL
  1       2     0.2   Y
  2       3     0.5   N
  3       4     0.5   N
  8       9     1.5   Y
  9       10    0.1   N
  10            0.2   N
  </code></pre>
  <p>Expected output</p>
  <pre><code>ID_P    Sum(SLA)
  1       1.2
  8       1.8
  </code></pre>
  <p>Can someone please help me with the SQL.</p>