Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for more optimization
Message
De
11/02/2009 22:34:18
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Web
Divers
Thread ID:
01381114
Message ID:
01381126
Vues:
51
>I don't see why you need JOIN in this case. Wouldn't following query produce the same result?
>
>SELECT Member.Numero,Member.Nom,Member.Prenom,Member.LastAccess
>	FROM Member 
>	WHERE Member.LastAccess >= @LastAccess 
>		AND Member.Numero = @NoMember
>		AND EXISTS ( SELECT 1 FROM Monitor WHERE Monitor.NoMember2 = @NoMember )
>	ORDER BY 2	
>
I think you wanted to write this:
DECLARE @NoMember Integer
DECLARE @LastAccess DateTime

SET @NoMember=1
SET @LastAccess='2009-02-10 11:46:55'

SELECT Member.Numero,Member.Nom,Member.Prenom,Member.LastAccess
 FROM Member 
 WHERE Member.LastAccess>=@LastAccess 
 AND EXISTS (SELECT 1 FROM Monitor WHERE Monitor.NoMember2=Member.Numero AND Monitor.NoMember=@NoMember)
Is that correct?

If yes, is this an optimized route?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform