Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select last line of multiple values
Message
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 8
Divers
Thread ID:
00984170
Message ID:
00984188
Vues:
24
This message has been marked as the solution to the initial question of the thread.
Hi Zakaria,
* Create Index cursor
SELECT Special,Fundvalue,RECNO() AS Index FROM Table INTO CURSOR XXC

* Find max index by key
SELECT Special,MAX(Index) AS MaxIndex FROM XXC GROUP BY Special INTO CURSOR XXB

* Creae final cursor
SELECT XXB.Special,XXC.fundvalue FROM XXB,XXC WHERE XXB.MaxIndex=XXC.index INTO CURSOR XXEnd

USE IN XXB
USE IN XXC

SELE XXEnd
BROW 
USE IN XXEnd
MartinJ


>Hello All,
>
>I have a table with two fields : Special , FundValue. There are some replicating records for special with the same value, I want to select the last record of these multiple values .
>
>For example
>
>Special Fundvalue
>0000001 10000.00
>0000001 10010.00
>0000001 10009.00
>0000002 10080.00
>0000002 10090.00
>0000003 10100.00
>
>I want to create a query that gives me the next result
>Special Fundvalue
>0000001 10009.00
>0000002 10090.00
>0000003 10100.00
>
>Is this possible?
>
>Thanks in advance.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform