title: how to take a sum value of selected column 's selected raws
body: <p>I'm having two invoice id ( "inid") from indetails table using resultset which I made before . And I want to take sum value of qty of invoice table which equal to invoice ids ("inid") I took before. </p>
  
  <p>Table name is " invoice ". And primary keys are "inid" (invoice id), "itid" (item id), "cuid" (customer id).</p>
  
  <pre><code>| inid | itid | cuid | itname | qty | sprice | total|
  | 1    | 1    | 1    | item1  | 25  | 250    | 6250 |
  | 2    | 1    | 1    | item2  | 15  | 250    | 3750 |
  </code></pre>
  
  <p>And this is my sql query. </p>
  
  <pre><code>try {
      ResultSet rs3 = db.getData("SELECT SUM(qty) AS Total FROM invoice WHERE inid='"  +   rs1.getInt("inid") + "'");
  
      while(rs3.next()){
          int val =  rs3.getInt("Total");
      }
  }
  catch (Exception e) {
      JOptionPane.showMessageDialog(null, this.getClass().getName() + "rs2 " + e);
  }
  </code></pre>
  
  <p>I'm only having first raw's column "qty"'s value. I want to take the sum of whole value of "qty" which equals with "inid" (invoice ids)</p>