Comparaison SQL
2pax.cruz
-
malaik5 Messages postés 282 Statut Membre -
malaik5 Messages postés 282 Statut Membre -
Bonjour, bonjour.
J'espère que vous saurez m'aider mais j'ai une question en SQL.
Sur Access, j'essaye de faire une requête.
J'ai une requête qui comporte plusieurs SELECT liés par UNION. Il y a également une clause WHERE.
Lorsque j'execute ma requête, aucun problème.
Mais on me demande de retrouver les différences entre deux résultats de cette requête si on les execute avec une variable différente (variable utilisée dans la clause WHERE)
Pouvez-vous m'aider ?
Je vous remercie d'avance :)
J'espère que vous saurez m'aider mais j'ai une question en SQL.
Sur Access, j'essaye de faire une requête.
J'ai une requête qui comporte plusieurs SELECT liés par UNION. Il y a également une clause WHERE.
Lorsque j'execute ma requête, aucun problème.
Mais on me demande de retrouver les différences entre deux résultats de cette requête si on les execute avec une variable différente (variable utilisée dans la clause WHERE)
Pouvez-vous m'aider ?
Je vous remercie d'avance :)
A voir également:
- Comparaison SQL
- Comparaison million milliard - Accueil - Technologies
- Logiciel sql - Télécharger - Bases de données
- Logiciel comparaison photo gratuit - Télécharger - Photo & Graphisme
- Comparaison prix amazon - Accueil - Commerce
- Comparaison samsung a15 et a16 - Accueil - Téléphones
7 réponses
Bon courage :)
SELECT [Drive_O Attribute with User].Path, [Drive_O Attribute with User].Access, [Drive_O Attribute with User].fullname, [Drive_O Attribute with User].NameSG1, [Drive_O Attribute with User].NameSG2, [Drive_O Attribute with User].NameSG3, [Drive_O Attribute with User].NameSG4, [Drive_O Attribute with User].NameSG5 FROM [Drive_O Attribute with User] WHERE ((([Drive_O Attribute with User].fullname) Like ["Initiales"])) UNION SELECT [Drive_O Attribute with User].Path, [Drive_O Attribute with User].Access, [Drive_O Attribute with User].fullname, [Drive_O Attribute with User].NameSG1, [Drive_O Attribute with User].NameSG2, [Drive_O Attribute with User].NameSG3, [Drive_O Attribute with User].NameSG4, [Drive_O Attribute with User].NameSG5 FROM [Drive_O Attribute with User] WHERE ((([Drive_O Attribute with User].NameSG1) Like ["Initiales"])) UNION SELECT [Drive_O Attribute with User].Path, [Drive_O Attribute with User].Access, [Drive_O Attribute with User].fullname, [Drive_O Attribute with User].NameSG1, [Drive_O Attribute with User].NameSG2, [Drive_O Attribute with User].NameSG3, [Drive_O Attribute with User].NameSG4, [Drive_O Attribute with User].NameSG5 FROM [Drive_O Attribute with User] WHERE ((([Drive_O Attribute with User].NameSG2) Like ["Initiales"])) UNION SELECT [Drive_O Attribute with User].Path, [Drive_O Attribute with User].Access, [Drive_O Attribute with User].fullname, [Drive_O Attribute with User].NameSG1, [Drive_O Attribute with User].NameSG2, [Drive_O Attribute with User].NameSG3, [Drive_O Attribute with User].NameSG4, [Drive_O Attribute with User].NameSG5 FROM [Drive_O Attribute with User] WHERE ((([Drive_O Attribute with User].NameSG3) Like ["Initiales"])) UNION SELECT [Drive_O Attribute with User].Path, [Drive_O Attribute with User].Access, [Drive_O Attribute with User].fullname, [Drive_O Attribute with User].NameSG1, [Drive_O Attribute with User].NameSG2, [Drive_O Attribute with User].NameSG3, [Drive_O Attribute with User].NameSG4, [Drive_O Attribute with User].NameSG5 FROM [Drive_O Attribute with User] WHERE ((([Drive_O Attribute with User].NameSG4) Like ["Initiales"])) UNION SELECT [Drive_O Attribute with User].Path, [Drive_O Attribute with User].Access, [Drive_O Attribute with User].fullname, [Drive_O Attribute with User].NameSG1, [Drive_O Attribute with User].NameSG2, [Drive_O Attribute with User].NameSG3, [Drive_O Attribute with User].NameSG4, [Drive_O Attribute with User].NameSG5 FROM [Drive_O Attribute with User] WHERE ((([Drive_O Attribute with User].NameSG5) Like ["Initiales"]));
Je comprends bien le SQL mais j'ai beaucoup de mal avec acces :D à quoi correspond la table FROM [Drive_O Attribute with User]?
Cette grosse requete ne serait elle pas plus simple avec :
Select * from Ta_table where
([Drive_O Attribute with User].NameSG5) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG1) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG2) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG3) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG4) Like ["Initiales"])
oe
([Drive_O Attribute with User].NameSG5) Like ["Initiales"]);
?
Cette grosse requete ne serait elle pas plus simple avec :
Select * from Ta_table where
([Drive_O Attribute with User].NameSG5) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG1) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG2) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG3) Like ["Initiales"])
or
([Drive_O Attribute with User].NameSG4) Like ["Initiales"])
oe
([Drive_O Attribute with User].NameSG5) Like ["Initiales"]);
?
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Bonjour,
J'ai eu du mal à lire la requete aussi,
Mais je voulais juste savoir, si t'as pu écrire une requete aussi compliquée que celle là, tu ne sauras pas répondre à ta simple question ??
et en plus ce qu'il faut savoir c'est que les jointures sont vraiment gourmandes en temps de réponses donc si on peut les éviter au max c'est impécable
Bon courage
J'ai eu du mal à lire la requete aussi,
Mais je voulais juste savoir, si t'as pu écrire une requete aussi compliquée que celle là, tu ne sauras pas répondre à ta simple question ??
et en plus ce qu'il faut savoir c'est que les jointures sont vraiment gourmandes en temps de réponses donc si on peut les éviter au max c'est impécable
Bon courage