Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
85 selects on a large database - looking for a way to simpli
Message
De
28/07/1999 10:22:56
Dag Arneson
Cornell Univerity Hotel School
Ithaca, New York, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
85 selects on a large database - looking for a way to simpli
Divers
Thread ID:
00247128
Message ID:
00247128
Vues:
58
I am trying to create a report for use of a computer lab. There are 5 separate sub-labs which I want to separate, and 17 different hours, 8 am - 12 midnight. The way I am currently using uses 17 * 5 or 85 select statements. As the log file size increases, these select statements could take quite a while. Is there a better (faster) way to do this?
FOR labnum = 1 to 5
  FOR hournum = 8 TO 24
    SELECT uselog.time_in, uselog.time_out, computer.res_loc ;
      FROM uselog INNER JOIN computer ;
      ON ((uselog.comp_id = computer.res_id) AND (computer.res_loc = labnum) AND ;
      (BETWEEN(DTOT(gdreportdate)+(hournum*3600), uselog.time_in, uselog.time_out))) ;
      INTO CURSOR useless  && So a browse window doesn't pop up
    gausage[labnum, hournum - 7] = _TALLY
    SELECT useless
    USE
   ENDFOR
ENDFOR
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform