2013-05-16 58 views

回答

1
String queryString = " SELECT * FROM customer c"; 
queryString += " WHERE ? = (SELECT count(*) FROM account a WHERE a.cust_id = c.cust_id)"; 

PreparedStatement stmt = connection.prepareStatement(queryString); 
stmt.setInt(1, theCountYouLookFor) // theCountYouLookFor would be 2 in your example 
相關問題