Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combine 2 tables - better way?
Message
De
23/02/2004 19:03:09
 
 
À
23/02/2004 18:44:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00880102
Message ID:
00880120
Vues:
24
hello Fred

Thanks for your reply. tryed it but so far have only been able to get a blank cursor back. i am trying to tackel it tomorow. maybe with a fresh head i will see what i am doing wrong.

i'll let you know if i get it to work tommorow
thanks


>>hello everybody.
>>
>>currently i have the following (simplyfied):
>>sele a.idfld ;
>>   from 'history\frames' a ;
>>   where SomeCondition ;
>>   into cursor cur_temp1
>>
>>sele a.idfld ;
>>   from 'current\frames' a ;
>>   where ;
>>      SameCondition .and. ;
>>      a.idfld not in (select temp.idfld from cur_temp1) ;
>>   into cursor cur_temp2
>>
>>(make cur_temp1 read/write)
>>
>>sele cur_temp1
>>append from cur_temp2
>>use in cur_temp2
>>
>>is there a better, more propper way of doing this (preferably with 1 sql command)?
>>
>>thanks for all your help!
>
>SELECT hist.idfld1 FROM history\frames hist ;
>  WHERE SomeCondition ;
>  UNION ALL ;
>  SELECT cur.idfld1 FROM current\frames cur ;
>    WHERE SomeCondition AND cur.idfld1 NOT IN (SELECT idfld1 FROM history\frames WHERE Somecondition) ;
>  INTO CURSOR combined
>
>I think that should work.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform