Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimize a where Sql clause
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Optimize a where Sql clause
Miscellaneous
Thread ID:
01165268
Message ID:
01165268
Views:
62
Hello,

Is it possible to optimize this sql clause ?
Thank you in advance.

bernhart
 WHERE  IIF( ?vp_sommeil = .T. , .T. , Employee.lsommeil = ?vp_sommeil )  AND ;
  IIF( EMPTY( ?Vp_debut ) , IIF( EMPTY( ?Vp_nom ) , .T. , TELEPH.Cnomteleph  = ?Vp_nom ) AND  ;
  IIF( ?Vp_lpresent  =  .T. , EMPTY( Employee.Dsortie ) , .T. ) , BETW( Employee.Dentree , ?Vp_debut , ?Vp_Fin )= .T.  OR  ;
  BETW( Employee.Dsortie , ?Vp_debut , ?Vp_Fin )= .T.  OR  ( EMPTY( Employee.Dsortie ) AND Employee.Dentree < ?Vp_debut ) OR ;
  (  Employee.Dsortie > ?Vp_Fin  AND Employee.Dentree < ?Vp_debut ) )    ;
  GROUP BY  Employee.Iid   ORDER BY  Employee.Iid
Next
Reply
Map
View

Click here to load this message in the networking platform