Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not in statement
Message
De
03/03/2004 20:32:49
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
03/03/2004 09:55:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00882687
Message ID:
00882964
Vues:
19
>The below works:
>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
>  WHERE !EMPTY(lcontrol.cn_name) .and. lcontrol.cn_name IN ;
>  (SELECT ctrlname FROM ctrlset WHERE ctrlset.printform = .T.);
>  INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
>
>so does the reverse:
>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
>  WHERE !EMPTY(lcontrol.cn_name) .and. lcontrol.cn_name IN ;
>  (SELECT ctrlname FROM ctrlset WHERE ctrlset.printform = .F.);
>  INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
>
However, the reverse of the first using NOT does not work, any idea why anyone?
>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
>  WHERE !EMPTY(lcontrol.cn_name) .and. lcontrol.cn_name NOT IN ;
>  (SELECT ctrlname FROM ctrlset WHERE ctrlset.printform = .T.);
>  INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
>
The 2nd two statements should produce the same results, but they do not. What is wrong with the "not in" portion?

Hi Tracy,

What do you get with this?
SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
  WHERE !EMPTY(lcontrol.cn_name) .and. ;
  NOT EXISTS(SELECT ctrlname FROM ctrlset 
  WHERE lcontrol.cn_name = ctrlset.ctrlname AND ctrlset.printform = .T.);
  INTO TABLE (hdir+"tTEMPLCONTROL.DBF")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform