Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible better way
Message
De
27/08/2008 16:05:18
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01342342
Message ID:
01342349
Vues:
15
>Does anyone know a better way to do this? If I comment out the OR with the Begin and Endtimes, this this is fast. This method is accurate and gets all possibilites, but the duration is 1440 in sql profiler vs 13 without the OR's.
>
>
>
>WHERE m.meetingnumber <> @CaseId
>AND m.patientid = @PatientId
>AND
>(
>	(@Start > m.begintime AND @Start < m.endtime)
>	OR (@End > m.begintime AND @End < m.endtime)
>	OR (m.begintime > @Start AND m.begintime < @End)
>	OR (m.endtime > @Start AND m.endtime < @End)
>	OR (@Start = m.begintime AND @End = m.endtime)
>)
>
Seems like you have several OR's. Can you be more specific?
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform