Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WHERE NOT IN syntax
Message
De
16/08/2005 12:17:12
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
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01041362
Message ID:
01041367
Vues:
17
>I'm having trouble getting the correct syntax for this:
> SELECT NoSerial_No, [No Descrip] AS StockNo_Des ;
> FROM No_Serial WHERE NoSerial_Amt > 0 AND ;
> NoSerial_No NOT IN ;
> (SELECT StockNo_No FROM StockNo)
>
>Although I'm not getting errors, the result does not contain NoSerial_No records which do not exist in the StockNo table... in fact the result is an empty cursor.
>
>TIA

The syntax looks proper and seemly to me; you may want to check:
  • The result of the subquery by itself.
  • Try a reindex, in case indices are corrupt.
  • Whether any record fulfills BOTH conditions (since you have an AND) - you may want to try without the left part first, omitting NoSerial_Amt > 0 AND.
  • Whether the fields for the comparison are compatible (same size). I am not sure what would happen if they are not.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform