skip to Main Content

Mysql – conditional sum sql query

My table structure is following : CREATE TABLE `tbl_erp_invoice_lines` ( `ID` INT(11) NOT NULL AUTO_INCREMENT, `INVOICE_ID` INT(11) NULL DEFAULT NULL, `PRODUCT_ID` INT(11) NULL DEFAULT NULL, `LINE_UNIT` VARCHAR(10) NULL DEFAULT 'KG' COLLATE 'utf8_bin', `LINE_PRICE` DECIMAL(7,3) NULL DEFAULT NULL, `LINE_QUANTITY` INT(11) NULL…

VIEW QUESTION

Mysql – How to check for a condition within a while loop java

String valChecker = "SELECT * FROM `committee_memba` where (Rank= 'Chairperson' or Rank='Vice-Chair') and committee_name='" + jComboBox1.getSelectedItem().toString() + "'"; System.out.println(valChecker); PreparedStatement stmt = conn.prepareStatement(valChecker); rs = stmt.executeQuery(); while (rs.next()){ String rnk = rs.getString("Rank"); System.err.println(rnk); if ((rnk.equals("Chairperson") && rank.equals("Chairperson")) || (rnk.equals("Vice-Chair") &&…

VIEW QUESTION
Back To Top
Search