Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not in statement
Message
De
03/03/2004 15:22:51
 
 
À
03/03/2004 10:13:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
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:
00882872
Vues:
15
Thanks Hilmar,

I realize that and the example I posted was not a really good example to use because while it is possible that they COULD produce different results for the reasons you mentioned, in THIS case they should produce the same results based on the values in the records and whether or not the records exist in the appropriate tables.

Thanks!


>>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?
>
>It seems to me they should produce different results. You can have different subsets of data for .T. and .F.; IN and NOT IN would work on the corresponding subsets, which may, or may not, be related. I suggest you experiment on paper, with some sample data, to see whether you get the same results or not.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform