Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select oldest record
Message
De
18/09/2007 14:59:57
 
 
À
18/09/2007 14:53:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01255231
Message ID:
01255242
Vues:
11
CREATE CURSOR MyTable (PK_MyTable I, MyTableDesc C (50), ts T)
INSERT INTO MyTable VALUES (1, "Oldest record", DATETIME())
WAIT WINDOW TIMEOUT 1
INSERT INTO MyTable VALUES (2, "Second oldest record", DATETIME())
WAIT WINDOW TIMEOUT 1
INSERT INTO MyTable VALUES (3, "Newest record", DATETIME())

SELECT MyTable.* FROM MyTable WHERE MyTable.ts IN (SELECT MIN (MyTable.ts) FROM MyTable)
HTH

>does SELECT support a parameter that would allow the selection of the single oldest record in the table? Something like
>
>select min(datetimefield) from mytable
>
>but retrieving all the fields?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform