Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difficulty writing SQL Statement
Message
 
 
À
07/01/2009 21:21:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01371924
Message ID:
01371939
Vues:
16
>Ah. Correct.
>But, I still get the wrong record set.
>The only way I can get it not to give me the wrong set of group records are to change it as so:
>
>select rule.* from rule INNER JOIN users on rule.cuserid = users.cid where Users.cID = ?vp_cuserid ;
>UNION all;
>select rule.* from rule INNER JOIN users on rule.cgroupid = users.cgroupid where Users.cID = ?vp_cuserid and rule.cgroupid <> "ZZZZZZ"
>
>
>But is this an incorrect way to try to accomplish this?

You don't need JOIN in the first select in UNION otherwise query looks fine to me
select rule.* from rule WHERE rule.cuserid = ?vp_cuserid ;
UNION all;
select rule.* from rule INNER JOIN users on rule.cgroupid = users.cgroupid where Users.cID = ?vp_cuserid and rule.cgroupid <> "ZZZZZZ"
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform