Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert and select
Message
From
04/06/2006 15:54:29
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
04/06/2006 08:41:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01126975
Message ID:
01127001
Views:
26
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform