Salu
dunque ho questo problema:
In java faccio una select da db MYSQL per tirare fuori i differenti id_risorsa, ed uso un banale while, all'interno dello stesso voglio implementare per il suddetto id_risorsa 52 query, il problema che non me lo lascia fare
codice a seguire
codice:ResultSet rs_risorse=sql.executeQuery("SELECT consuntivo.id_risorsa, risorse.nome_risorsa FROM consuntivo LEFT JOIN risorse on risorse.id_risorsa=consuntivo.id_risorsa GROUP BY id_risorsa"); while(rs_risorse.next()) { int id_risorsa=rs_risorse.getInt("id_risorsa"); nome_risorsa=rs_risorse.getString("nome_risorsa"); tabella=tabella+"<th>"+nome_risorsa+"</th>"; countrows++; for(i=1;i<53;i++) { //query_consuntivo="SELECT * FROM consuntivo WHERE id_commessa='1' AND id_risorsa="+id_risorsa+" AND settimana_consuntivo="+i; //out.println(query_consuntivo+" "); ResultSet rs_consuntivo=sql.executeQuery("SELECT * FROM consuntivo WHERE id_commessa=1 AND id_risorsa="+id_risorsa+" AND settimana_consuntivo="+i); giorni_consuntivo=rs_consuntivo.getInt("giorni_consuntivo"); riga_tabella=riga_tabella+"<td>"+giorni_consuntivo+"</td>"; } }

Rispondi quotando