Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Data from Remote Data Source Using SPT
Message
 
 
À
15/01/2009 13:39:14
Steven Dyke
Safran Seats USA
Texas, États-Unis
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 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01374143
Message ID:
01374145
Vues:
11
>I have a very large table that records munufacturing transactions. Each Customer Order can have several records of transactions. The two I am concerned with is RD and RI. I need to pull all the records prior to a particular date that have an RD transaction code but not an RI transaction code.

Would this work for you?
SELECT * FROM mytable mt
  WHERE TranDate < ?ldDate
    AND EXISTS (SELECT 1 FROM mytable 
                  WHERE OrderID = mt.OrderID and TranDate < ?ldDate AND TransactionCode = 'RD')
    AND NOT EXISTS (SELECT 1 FROM mytable 
                  WHERE OrderID = mt.OrderID and TranDate < ?ldDate AND TransactionCode = 'RI')
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform