Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select sql question
Message
De
13/11/1998 12:03:22
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00157425
Message ID:
00157449
Vues:
17
>>>want to refine my question. now i see the bigger picture.
>>>
>>>Want a sql result set that contains certain records from table1, and have matching records from table2.
>>>
>>>currently i have an sql that selects the desired records from table1. then i loop and readi each of those records and seek against table2. if the seek is not successful then i delete the result record. taking about 1 minute.
>>>
>>>any ideas how to make this more efficient.
>>>
>>>brenda
>
>>Select * From Table1 where MatchKey IN (Select MatchKey From Table2)
>
>having trouble with the actual sql syntax.
>
>select * from table1 where field1 = .t. into resulttable
>
>now only want the rows from resulttable that have a match on field2 and field3 in table2.
>
>obviously i would prefer to get both things done in a single statement, if possible. this is just the easiest way for me to explain it.
>
>thanks brenda

Select * From Table1 Into Resulttable Where Field1=.T. And Field2+Field3 IN (Select Field2+Field3 From Table2)
Table1 should be indexed on Field2+Field3 for better performance.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform