String sql = "select comm,avg(price) from comm_saleprice where zone = ? and comm in (?,?,?,?,?,?,?,?) and price <> '' GROUP BY comm "
+ "order by field(comm,?,?,?,?,?,?,?,?)";
stmt = conn.prepareStatement(sql);
stmt.setString(1, zone);
stmt.setString(2, top1);
stmt.setString(3, top2);
stmt.setString(4, top3);
stmt.setString(5, top4);
stmt.setString(6, top5);
stmt.setString(7, top6);
stmt.setString(8, top7);
stmt.setString(9, top8);
stmt.setString(10, top1);
stmt.setString(11, top2);
stmt.setString(12, top3);
stmt.setString(13, top4);
stmt.setString(14, top5);
stmt.setString(15, top6);
stmt.setString(16, top7);
stmt.setString(17, top8);