Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get 1st record if duplicate records found?
Message
 
 
À
30/10/2001 17:55:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00575370
Message ID:
00575378
Vues:
19
This message has been marked as the solution to the initial question of the thread.
You can do this in two selects
SELECT field1, field2 , RECNO() AS rn ;
	FROM test2 ;
	INTO CURSOR temp1

SELECT field1, field2 ;
	FROM temp1 ;
	WHERE field1 + STR(rn) IN ( ;
		SELECT field1 + STR(MIN(rn)) ;
			FROM temp1 GROUP BY field1)
>field1,field2
>abarca,2243
>abarca,3314
>abarca,2142
>
>I need to get the 1st record: abarca, 2243.
>SELECT * from table1 GROUP BY field1: returns the last record (abarca, 2142).
>What would be the correct SQL statement to do so?
>
>Thank you all!
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform