Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to combine two flds in one with on SQL Select?
Message
De
05/09/2005 18:25:29
 
 
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 8 SP1
Divers
Thread ID:
01046819
Message ID:
01046863
Vues:
17
>>
>>Yes
>>
>>
>>SELECT ROOM1 ROOM,RES_DATE,RES_TIME;
>> FROM Table WHERE condition1;
>>UNION; && this is a distinct union ( like a UNION NEWS
>>SELECT ROOM2,RES_DATE,RES_TIME;
>>FROM Table WHERE condition2;
>>
>
>I am sorry for troubling you again. But I have one more question, please. You showed me how to have two WHERE, one for each SELECT, top and bottom. What if I wanted to have one WHERE that would apply to the resulting cursor, the one created with UNION?

You can in VFP9
SELECT * FROM ;
(SELECT * FROM AA WHERE condition1;
UNION ALL;
SELECT * FROM AA WHERE condition2) SUBQUERY;
WHERE condition3
but you should watch out,
because in this case condition3 cannot use an index
(and to be optimized)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform