select distinct myField, recno() as rcno ; > from myTable into cursor crsUnique nofilter >select * from mytable where recno() in (select rcno from crsUnique)It sure looks like it would work. Here's a method I came up with that does work but may depend on internal implementation of SELECT-SQL GROUP BY to get correct results.
SELECT partnum,wonum; FROM workorders; ORDER BY partnum,wonum desc; INTO CURSOR uniq_wos NOFILTER SELECT partnum,wonum; FROM uniq_wos; ORDER BY partnum; GROUP BY partnum; INTO CURSOR uniq_wosThis works because (apparently) GROUP BY selectitem returns the row of the last selectitem it finds in the source set as the representative row of the group....(makes sense if you're summing, averaging, etc). However, though it stands to reason that GROUP BY should work this way by definition, I do not know if that is a fact ... or it is just the way my version of VFP implements it.