Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT Syntax help
Message
De
24/08/2010 17:11:51
Steven Dyke
Safran Seats USA
Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SPT Syntax help
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01478231
Message ID:
01478231
Vues:
108
Remote Database is DB2.

I have table a which is a list of part numbers.

Table b is a list of inspections performed on these part numbers. This table can have multiple records of each part number. Each record has a datetime stamp field and a status.

I need a list of part numbers from table a where the last record(greatest datetime stamp) is status 2(rejected).
Select partno From table a Where partno in (Select partno From table b Where status = 2 Order By datetime stamp Desc Fetch First 1 Rows Only)
This gives me the first record of the part number group with a status of 2. However, there is a newer record with a status of 1 so this record should not be in result set.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform