Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional select statement
Message
De
28/02/2006 11:16:08
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01099679
Message ID:
01099926
Vues:
18
>Hi Fabio,
>
>I forgot to mention that join to Groups is derived, e.g. first I have to join to UsGrLink table. I guess, I would probably have to go with two separate paths depending on class property (e.g. I can add some property like lTransferAccounts, that would be true for the second case).
>

Where is the problem ? LEFT JOIN is ignored if ON return a NULL.
Is the problem into the projection fields list ?
Post the two versions wished.

>>>Hi everybody,
>>>
>>>I have a queue assignment form that allows to get accounts from UNASSIGNED queue or from a particular investigator.
>>>
>>>In the first case one of the condition will look like:
>>>
>>>and Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk IS NULL, in the other case the condition would be
>>>Trans.cCommissioned_Owner = m.tcUserID
>>>
>>>Now, in the second case I'd like to join to another table (Groups) and get some fields from it. How can I make this generic, e.g. my routine doesn't know which type of WHERE condition I'm passing (I'm just passing lcWhereStr) for my select statement? In other words, I want to join with Groups table if cCommission_Owner_UsGrLink_fk is not null, otherwise I want to just put null placeholders instead of the fields.
>>>
>>>Thanks in advance.
>>
>>
>>...
>>LEFT JOIN Groups ON join condition AND cCommission_Owner_UsGrLink_fk IS NOT NULL
>>WHERE ....
>>
>>* PROBABLY
>>...
>>LEFT JOIN Groups ON Groups.somefield=Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk
>>WHERE ...
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform