Hi,
ich hab hier ein Problem mit ner SQL Abfrage. Und zwar möchte ich folgendes counten:
Code:
//Hole mir Anzahl Fehltage zur Art_ID
$query = "SELECT count(*) from eae_fehldata where sid='$sid' AND art_id='$art_id';";
$result=mysql_query("$query") or die (mysql_error());
//Hole mir Anzahl "unentschuldigter" Fehltage zur Art_ID
$query = "SELECT count(*) from eae_fehldata where sid='$sid' AND art_id='$art_id' AND ent_id='U';";
$result2=mysql_query("$query") or die (mysql_error());
Ich will einmal alle Fehltage zählen die von einer bestimmten Art sind, und dann noch alle Fehltage die von einer bestimmten Art sind aber noch das Attribut "unentschuldigt" U gesetzt ist.
Problem ist, dass die tabelle eae_fehldata ziemlich groß ist und somit es ewig dauert bis beide Selects ausgeführt wurden.
Kann man das irgendwie auf ein Select reduzieren?
Danke schon mal für eure Hilfe.
Gruß,
Buz :)