Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get 1st record if duplicate records found?
Message
 
 
To
30/10/2001 17:55:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00575370
Message ID:
00575378
Views:
20
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform