title: Calculate rate of Columns in Oracle
body: <p>I have table like below.I also keep a variable in the Oracle package to use in the table below.</p>
  <p>For example : q_value = 27;</p>
  <p>For each piece column by grouping the table,I want to do this calculation
  q_value * ((piece_value)/(all_piece_values))</p>
  <p>FOR 2111TN IS RATE VALUE:27*/(658)/(658+388))</p>
  <p>FOR 2112TN IS RATE VALUE:27*/(388)/(658+388))</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">PIECE</th>
  <th style="text-align: center;">MPIECE</th>
  <th style="text-align: right;">PART</th>
  <th style="text-align: right;">VALUE</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">2111TN</td>
  <td style="text-align: center;">2110HB</td>
  <td style="text-align: right;">1</td>
  <td style="text-align: right;">658</td>
  </tr>
  <tr>
  <td style="text-align: left;">2111TN</td>
  <td style="text-align: center;">2110HB</td>
  <td style="text-align: right;">1</td>
  <td style="text-align: right;">658</td>
  </tr>
  <tr>
  <td style="text-align: left;">2112TN</td>
  <td style="text-align: center;">2110HB</td>
  <td style="text-align: right;">2</td>
  <td style="text-align: right;">388</td>
  </tr>
  <tr>
  <td style="text-align: left;">2112TN</td>
  <td style="text-align: center;">2110HB</td>
  <td style="text-align: right;">2</td>
  <td style="text-align: right;">388</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>so the result of the query is for me ,should be as follows :</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">PIECE</th>
  <th style="text-align: center;">MPIECE</th>
  <th style="text-align: right;">PART</th>
  <th style="text-align: right;">VALUE</th>
  <th style="text-align: right;">RATE</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">2111TN</td>
  <td style="text-align: center;">2110HB</td>
  <td style="text-align: right;">1</td>
  <td style="text-align: right;">658</td>
  <td style="text-align: right;">17</td>
  </tr>
  <tr>
  <td style="text-align: left;">2112TN</td>
  <td style="text-align: center;">2110HB</td>
  <td style="text-align: right;">2</td>
  <td style="text-align: right;">388</td>
  <td style="text-align: right;">10</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How should I create a query?</p>