Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - SELECT command
Message
 
À
19/11/1998 02:21:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00159134
Message ID:
00159146
Vues:
38
>Hi all,
>
>I have two problems:
>
>1.)
>I have table. From this table I want create cursor where get to all record in this cursor number for his position in cursor.
>First record in cursor have "position" 1, second record in cursor have
>"position" 2, ....
>The "position" is new column in cursor.
>How Can I solve this problem ?

Open the table in the table designer and add a field named 'position'. Make it a primary index and set the default value to a stored procedure that generates a new unique position number.


>
>2.)
>How Can I create SELECT (cursor), where load only one record with specified position by ORDER item.
>Example: I want get only 5th record from table ordered by "name" ("name" is index column in table)
>
>Thanks.

You can't order the fields in a record using 'order by'. You you can order the fields in the cursor by using SELECT field2, field4, filed1 etc. If you want the 5th record, SELECT f1,f3,f2 from mytable where position = 5 into cursor x
ORDER BY is used for multiple record select statements.

Eric K.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform