Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert and select
Message
De
04/06/2006 15:54:29
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
04/06/2006 08:41:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01126975
Message ID:
01127001
Vues:
23
>insert INTO mstr ;
>    SELECT * FROM main2 WHERE file_date , intervdate NOT IN 
    (SELECT file_date,intervdate FROM mstr)&&try no.1 not work
>
>    SELECT * FROM main2 WHERE file_date and intervdate NOT IN 
    (SELECT file_date and intervdate FROM mstr)&&try no.2 not work
>can i make compare for all fields before insert as
>insert INTO mstr ;
>    SELECT * FROM main2 WHERE all fields NOT IN 
    (SELECT ALL FIELDS FROM mstr)
>
Hi Mohammed,

As you've found out, none of those constructs are valid SQL. It sounds like you're looking for duplicates. First you have to define what constitutes a duplicate and then you can to concatenate all the conditions using STR() for Logical, Numeric and Date values. Be sure not to use Alltrim() or Transform() since they trim extra blanks:
Select * From Table1 Where ;
    chrField + DtoS(dtField) + Str(numField) Not In ;
    (Select chrField + DtoS(dtField) + Str(numField) ;
    From Table2)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform